int386

interrupt the CPU

Synopsis:

#include <i86.h>
int int386( int inter_no,
            const union REGS *in_regs,
            union REGS *out_regs );

Description:

The int386() function causes the computer's central processor (CPU) to be interrupted with an interrupt whose number is given by inter_no. This function is present in the 386 C libraries, and may be executed on 80386/486 systems. Before the interrupt, the CPU registers are loaded from the structure located by in_regs. Following the interrupt, the structure located by out_regs is filled with the contents of the CPU registers. These structures may be located at the same location in memory.

You should consult the technical documentation for your computer to determine the expected register contents before and after the interrupt in question.

Returns:

the value of the CPU EAX register after the interrupt

See also:

int386x(), int86(), int86x(), intr(), segread()

Examples:

/*
 * This example clears the screen on DOS
 */
#include <i86.h>

void main()
  {
    union REGS    regs;

    regs.w.cx = 0;
    regs.w.dx = 0x1850;
    regs.h.bh = 7;
    regs.w.ax = 0x0600;
#ifdef __386__
    int386( 0x10, &regs, &regs );
#else
    int86( 0x10, &regs, &regs );
#endif
  }

Classification:

Intel

Systems:

DOS/32, QNX/32, Netware