Name
int86 - Executes an interrupt.
Syntax
#include <dos.h>
int int86(intno, inregs, outregs)
int intno;
union REGS *inregs;
union REGS *outregs;
Description
The int86 function executes the 8086-processor-family
interrupt specified by the interrupt number intno. 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 argument outregs. The inregs and outregs
arguments are unions of type REGS. The union type is defined
in the include file dos.h.
The int86 function is used to invoke DOS interrupts
directly.
Do not use the int86 function to call interrupts that modify
the DS register. Instead use the intdosx or int86x function.
The intdosx and int86x functions load the DS and ES
registers from the segregs parameter and also store the DS
and ES registers into segregs after the function call.
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.
See Also
bdos(DOS), intdos(DOS), intdosx(DOS), int86x(DOS)
Example
#define VIDEO_IO 0x10 #define SET_CRSR 1
#include <dos.h> #include <stdio.h>
union REGS regs;
main()
{
int top, bot;
/* Get new cursor size from user: */
printf ("Enter new cursor top and bottom: \n");
scanf("%d %d", &top, &bot);
/* Set up for cursor change call: */
regs.h.ah = SET_CRSR;
regs.h.ch = top;
regs.h.cl = bot;
/* Execute interrupt: */
int86(VIDEO_IO, ®s, ®s);
}
This program uses int86 to call the IBM-PC BIOS video
service (INT 10H) to change the size of the cursor.
The default values are as follows:
Configuration Default Values
Monochrome card 12, 13
Color card 6, 7
43-line EGA 4, 5
(printed 6/18/89)