Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- dBsee 4.6 - The Library - <b>dfpeekw()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
dfPeekW()
Reads a WORD from memory
------------------------------------------------------------------------------
Syntax:

     dfPeekW( <nSeg>, <nOfs> ) --> nMemory

Parameters:

     <nSeg>     Memory segment.
     <nOfs>     Memory offset.

Returns:

     <nMemory> Value read in memory.

Description:

     Reads a WORD from memory.

Example:

     // Reads the address of the ports
     LOCAL nCom1, nCom2, nCom3, nCom4,;
           nLpt1, nLpt2, nLpt3, nLpt4
     
     nCom1 := dfPeekW( dfHex2Dec("0040"), dfHex2Dec("00") )
     nCom2 := dfPeekW( dfHex2Dec("0040"), dfHex2Dec("02") )
     nCom3 := dfPeekW( dfHex2Dec("0040"), dfHex2Dec("04") )
     nCom4 := dfPeekW( dfHex2Dec("0040"), dfHex2Dec("06") )
     nLpt1 := dfPeekW( dfHex2Dec("0040"), dfHex2Dec("08") )
     nLpt2 := dfPeekW( dfHex2Dec("0040"), dfHex2Dec("0A") )
     nLpt3 := dfPeekW( dfHex2Dec("0040"), dfHex2Dec("0C") )
     nLpt4 := dfPeekW( dfHex2Dec("0040"), dfHex2Dec("0E") )
     
     ? dfDec2Hex( nCom1 ) // Address of COM1
     ? dfDec2Hex( nCom2 ) // Address of COM2
     ? dfDec2Hex( nCom3 ) // Address of COM3
     ? dfDec2Hex( nCom4 ) // Address of COM4
     ? dfDec2Hex( nLpt1 ) // Address of LPT1
     ? dfDec2Hex( nLpt2 ) // Address of LPT2
     ? dfDec2Hex( nLpt3 ) // Address of LPT3
     ? dfDec2Hex( nLpt4 ) // Address of LPT4

See also:

     dfHex2Dec(), dfPoke(), dfPspSeg()

See Also: dfHex2Dec() dfPoke() dfPspSeg()

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