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>outpw() write word to i/o port</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 outpw()                 Write Word to I/O Port

 #include   <conio.h>

  int outpw(port, word);
  unsigned port;    Port number
  unsigned word;    Output value

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

    Returns:    outpw() returns the word written to 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 writes a word to the first serial port

           #include <conio.h>

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

              result = outpw(port, word);
              printf("The value written to the serial port is %u\n", result);

           }


See Also: inpw() inp() outp()

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