int86
General 8086 software interrupt.
Defined in header <dos.h>
Syntax
#include <dos.h>
int int86(int intno,union REGS *inregs,union REGS *outregs);
Portability
| DOS | UNIX | Windows | ANSI C | C++ only |
|---|---|---|---|---|
| ■ | ■ |
Remarks
int86 executes an 8086 software interrupt specified by the argument intno. Before executing the software interrupt, it copies register values from inregs into the registers.
After the software interrupt returns, int86 copies the current register values to outregs, copies the status of the carry flag to the x.cflag field in outregs, and copies the value of the 8086 flags register to the x.flags field in outregs. If the carry flag is set, it usually indicates that an error has occurred.
Note that inregs can point to the same structure that outregs points to.
Return value
int86 returns the value of AX after completion of the software interrupt. If the carry flag is set (outregs -> x.cf lag ! = 0), indicating an error, this function sets the global variable _doserrno to the error code.
See also
Example
#include <stdio.h>
#include <conio.h>
#include <dos.h>
#define VIDEO 0x10
void movetoxydnt x, int y)
{
union REGS regs;
regs.h.ah = 2; /* set cursor postion */
regs.h.dh = y;
regs.h.dl = x;
regs.h.bh = 0; /* video page
int86 (VIDEO, ®s, ®s)
int main(void)
{
clrscr();
movetoxy(35, 10);
printf ("Hello\n");
return 0;
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Stable link: /3.1/dos.h/int86/
· short form /3.1/int86/