Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - portoutb() write a byte to an i/o port http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 portoutb()          Write a byte to an I/O port
------------------------------------------------------------------------------
 Declaration
   system.hdr

 Syntax
   proc portoutb extern
   param value uint uPortAddress, ;
         value uint uPortData

 Arguments
   uPortAddress is an output port number.
   uPortData is the byte to be output.

 Return
   None.

 Description
   The portoutb() procedure writes the data byte passed in uPortData to the
   specified I/O port.

   Incorrect use of this function may cause unpredictable results or loss of
   data.

 Example
   #define EXAMPLE_SYSTEM
   #include example.hdr

   proc KeyFast
   portoutb( 0x60, 0xf3 )      // send keyboard command
   waitms( 10 )
   portoutb( 0x60, 0x00 )      // set keyboard delay to zero
   endproc
   
   proc LEDsOn
   portoutb( 0x60, 0xed )      // send keyboard command
   waitms( 10 )
   portoutb( 0x60, 00000111b ) // set all three keyboard LEDS on
   endproc
   
   proc Test_portoutb
   KeyFast()                   // makes keyboard fast
   LEDsOn()                    // turn on keyboard lights
   endproc

   proc main
   Test_portoutb()
   endproc

See Also: I/O port address table portoutw()

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