_int86

Description

Executes an 8086 interrupt.

#include <dos.h>

int _int86( int intnum, union _REGS *inregs, union _REGS *outregs );

intnum Interrupt number  
inregs Register values on call  
outregs Register values on return  

Remarks

The _int86 function executes the 8086-processor-family interrupt specified by the interrupt number intnum. Before executing the interrupt, _int86 copies the contents of inregs to the corresponding registers. After the interrupt returns, the function copies the current register values to outregs. It also copies the status of the system carry flag to the cflag field in the outregs argument. The inregs and outregs arguments are unions of type _REGS. The union type is defined in the include file DOS.H.

Do not use the _int86 function to call interrupts that modify the DS register. Instead, use the _int86x function. (The _int86x function loads the DS and ES registers from the segregs parameter and also stores the DS and ES registers into segregs after the function call.)

The _REGS type is defined in the include file DOS.H.

Return Value

The return value is the value in the AX register after the interrupt returns. If the cflag field in outregs is nonzero, an error has occurred; in such cases, the _doserrno variable is also set to the corresponding error code.

Compatibility

Standards:None

16-Bit:DOS, QWIN, WIN, WIN DLL

32-Bit:None

See Also

_bdos, _int86x, _intdos, _intdosx

Example

/* INT86.C: This program uses _int86 to call the BIOS video service

* (INT 10H) to get information about the cursor.

*/

#include <dos.h>

#include <stdio.h>

void main( void )

{

union _REGS inregs, outregs;

/* Set up to get cursor information. */

inregs.h.ah = 3; /* Get Cursor Position function */

inregs.h.bh = 0; /* Page 0 */

/* Execute video interrupt: */

_int86( 0x10, &inregs, &outregs );

/* Display results. */

printf( “Cursor position\n\tRow: %d\n\tColumn: %d\n”,

outregs.h.dh, outregs.h.dl );

printf( “Cursor shape\n\tStart: %d\n\tEnd: %d\n”,

outregs.h.ch, outregs.h.cl );

}

Output

Cursor position

Row: 2

Column: 0

Cursor shape

Start: 6

End: 7