Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>inp() read a byte from the specified port</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 inp()                   Read a Byte from the Specified Port

 #include   <conio.h>                    Required for declarations only

 int        inp(port);
 unsigned   port;                        Port number

    inp() reads a byte from the specified input port 'port', which must
    be an unsigned integer in the range 0 to 65535.  The port does not
    have to be opened or closed before I/O is performed, so there are no
    corresponding open or close routines.

    Returns:    The byte read from 'port'; no error return.

      Notes:    The console I/O and port routines are not compatible with
                stream or low-level library routines and should not be
                used with them.

 Portability:   Applies to MS DOS only.

   -------------------------------- Example ---------------------------------

    The following statement reads a byte from port number 'port_num'.

           #include <conio.h>

           unsigned port_num;
           char ch;

           main()
           {
               port_num = ...
               ch = inp(port_num);
           }



See Also: outp()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson