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 - segofftouint() read a uint value from a segment/offset address http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 segofftouint()      Read a uint value from a segment/offset address
------------------------------------------------------------------------------
 Declaration
   memory.hdr

 Syntax
   func uint segofftouint extern
   param value uint uSegment, ;
         value uint uOffset

 Arguments
   uSegment is a segment address.
   uOffset is an offset address.

 Return
   A uint value.

 Description
   This function returns the uint located at the specified memory address.

   The function is included for compatibility with earlier Force versions.
   Use the ptr() data type in conjunction with the & and * operators for
   directly writing to explicit memory addresses.

 Example
   #define EXAMPLE_MEMORY
   #include example.hdr

   // Retrieve COM1 port address from BIOS data area
   
   proc Test_segofftouint
   vardef
      ptr( uint ) pMem
   enddef
   ? right( dechex( segofftouint( 0x40, 0 ) ), 4 ) // use function call
   pMem := 0x00400000                   // get value using pointer
   ? right( dechex( *pMem ), 4 )
   endproc

   proc main
   Test_segofftouint()
   endproc

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