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 - getregs() save current register values http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 getregs()           Save current register values
------------------------------------------------------------------------------
 Declaration
   system.hdr

 Syntax
   proc getregs extern

 Arguments
   None.

 Return
   None.

 Description
   The getregs() function saves the current processor register values in the
   __regs global system structure. The __regs.ip value contains the
   location that will be executed immediately after returning from the call
   to getregs().

 Example
   #define EXAMPLE_SYSTEM
   #include example.hdr

   proc Test_getregs
   getregs() // update __regs structure with current registyer values
   ? "Instruction pointer is", right( dechex( __regs.ip ), 4 )
   ? "Data segment is at", right( dechex( __regs.ds ), 4 )
   ? "Code segment is at", right( dechex( __regs.cs ), 4 )
   getregs() // value of the ip register will change
   ? "Instruction pointer is", right( dechex( __regs.ip ), 4 )
   endproc

   proc main
   Test_getregs()
   endproc

See Also: __bregs __regs doscall() setregs()

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