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

 Syntax
   func uint portinw extern
   param value uint uPortAddress

 Arguments
   uPortAddress is an input port number.

 Return
   The word read from the port.

 Description
   The portinw() function reads the data word 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_portinw
   vardef
      uint uPort
      uint uWord
   enddef
   uPort := 0x0                         // serial port 1
   uWord := portinw( uPort )
   ? "Word read from port", istr( uPort ), "is", istr( uWord )
   endproc

   proc main
   Test_portinw()
   endproc

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

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