Go to the first, previous, next, last section, table of contents.


int86

Syntax

#include <dos.h>

int int86(int ivec, union REGS *in, union REGS *out);

Description

Note: The .x. branch is a problem generator. Most code expects the .x. branch to have e.g. ".x.ax" members, and that they are 16-bit. If you know you want 32-bit values, use the .d.eax members. If you know you want 16-bit values, use the .w.ax members. The .x. members behave according to #defines, as follows:

default
If you specify no #define, the .x. branch has "ax" members and is 32-bit. This is compatible with previous versions of djgpp.
_NAIVE_DOS_REGS
This define gives you .x.ax, but they are 16-bit. This is probably what most programs ported from 16-bit dos compilers will want.
_BORLAND_DOS_REGS
This define gives you .x.eax which are 32-bit. This is compatible with Borland's 32-bit compilers.

This function simulates a software interrupt. Note that, unlike the __dpmi_int function, requests that go through int86 and similar functions are specially processed to make them suitable for invoking real-mode interrupts from protected-mode programs. For example, if a particular routine takes a pointer in BX, int86 expects you to put a (protected-mode) pointer in EBX. Therefore, int86 should have specific support for every interrupt and function you invoke this way. Currently, it supports only a subset of all available interrupts and functions:

1) All functions of any interrupt which expects only scalar arguments registers (i.e., no pointers to buffers).

2) In addition, the following functions of interrupt 21h are supported: 9, 39h, 3Ah, 3Bh, 3Ch, 3Dh, 3Fh, 40h, 41h, 43h, 47h, 56h.

When the interrupt is invoked, the CPU registers are copied from in. After the interrupt, the CPU registers are copied to out.

This function is just like int86x (see section int86x) except that suitable default values are used for the segment registers.

See section int86x. See section intdos. See section bdos.

Return Value

The returned value of EAX.

Portability

not ANSI, not POSIX

Example

union REGS r;
r.x.ax = 0x0100;
r.h.dl = 'c';
int86(0x21, &r, &r);


Go to the first, previous, next, last section, table of contents.