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 - intx86() execute 8086 software interrupt http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 intx86()            Execute 8086 software interrupt
------------------------------------------------------------------------------
 Declaration
   system.hdr

 Syntax
   func logical intx86 extern
   param value uint uInterrupt

 Arguments
   uInterrupt is the 8086 interrupt number to be executed.

 Return
   A logical indicating if the carry flag was clear when the interrupt
   call returned.

 Description
   The intx86() function executes the 8086 software interrupt specified by
   the passed parameter. The registers are set to the values in the
   __regs global system structure before the interrupt is executed.
   After the software interrupt completes, intx86() copies the current
   register values into __regs, from where the individual register values
   can be retrieved.

 Example
   #define EXAMPLE_SYSTEM
   #include example.hdr

   proc Test_intx86
   clear
   cursor( .f. )
   @ 0, 0 ?? "Press Esc to exit"
   do while .not. inkey() == K_ESC          // loop until escape key pressed
      __regs.ax  := 0x2c00                  // get time function
      intx86( 0x21 )                        // call DOS interrupt
      @ 0, 65 ?? padl( istr( __bregs.ch  ), 2, '0' ) + ":" + ; // hours
                 padl( istr( __bregs.cl  ), 2, '0' ) + ":" + ; // mins
                 padl( istr( __bregs.dh  ), 2, '0' ) + ":" + ; // secs
                 padl( istr( __bregs.dl  ), 2, '0' )           // sec/100
   enddo
   endproc

   proc main
   Test_intx86()
   endproc

See Also: __bregs __regs doscall()

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