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>inpw() read word from i/o port</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 inpw()                  Read word from I/O port

 #include   <conio.h>

  unsigned inpw(port);
  unsigned port;    Port number

    inpw() reads a two-byte word from the specified input port. The port
    and input values can be any unsigned integer from 0 to 65,535.

    Returns:    inpw() returns the word read from port. There is no error
                return.

      Notes:    Ports are hardware specific and form an integral part of
                both the internal and external computer communications.
                Values for the same port often vary across members of the
                PCJr,PC,XT,AT,PS/2 families, so a specific reference is
                needed for each computer the program is intended to run
                on.

                Unlike files or streams, ports do not need to be opened
                before use, or closed after use.

   Portability:     MS-DOS only

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

 This program reads a word from the first serial port

           #include             <conio.h>

           main()
           {
              unsigned int port = 0x3F8u;       /* primary PC/XT/AT serial
           port */
              unsigned int result;

              result = inpw(port);
              printf("The value from the serial port is %u\n", result);

           }


See Also: outpw() inp() outp()

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