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>outp() write a byte to the specified port</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 outp()                  Write a Byte to the Specified Port

 #include   <conio.h>                    Required for declarations only

 int        outp(port,value);
 unsigned   port;                        Port number
 int        value;                       Output value

    outp() writes 1 byte to the specified output port 'port'.  'port'
    must be an unsigned integer in the range 0-65535; value can be any
    integer in the range 0-255.  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 written to 'port'.  There is 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 writes a byte to the port that 'port' is
    assigned to.

           #include <conio.h>

           unsigned port;
           int val;

           main()
           {
           port = 1;
           val = 6;
               .
               .
               .
               outp(port,val);
           }


See Also: inp()

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