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 - portinb() read a byte from an i/o port http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 portinb()           Read a byte from an I/O port
------------------------------------------------------------------------------
 Declaration
   system.hdr

 Syntax
   func uint portinb extern
   param value uint uPortAddress

 Arguments
   uPortAddress is an input port number.

 Return
   The byte read from the port.

 Description
   The portinb() function reads the data byte available at 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 Test_portinb
   vardef
      uint uPort
      uint uChar
   enddef
   uPort := 0x0                         // serial port 1
   uChar := portinb( uPort )
   ? "Byte read from port", istr( uPort ), "is", istr( uChar )
   endproc

   proc main
   Test_portinb()
   endproc

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

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