Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <dos.h>
    int intdos( const union REGS *in_regs,
                union REGS *out_regs );

Description:
    The intdos function causes the computer's central processor (CPU) to be
    interrupted with an interrupt number hexadecimal 21 (0x21), which is a
    request to invoke a specific DOS function.  Before the interrupt, the
    CPU registers are loaded from the structure located by in_regs.  The AH
    register contains a number indicating the function requested.  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 the DOS operating
    system that you are using to determine the expected register contents
    before and after the interrupt in question.

Returns:
    The function returns the value of the AX (EAX in 386 library) register
    after the interrupt has completed.  The CARRY flag (when set, an error
    has occurred) is copied into the structure located by out_regs.  When an
    error has occurred,  errno contains a value indicating the type of error
    that has been detected.

Example:
    #include <dos.h>

    #define DISPLAY_OUTPUT  2

    void main()
      {
        union REGS  in_regs, out_regs;
        int         rc;

        in_regs.h.ah = DISPLAY_OUTPUT;
        in_regs.h.al = 0;

        in_regs.w.dx = 'I';
        rc = intdos( &in_regs, &out_regs );
        in_regs.w.dx = 'N';
        rc = intdos( &in_regs, &out_regs );
        in_regs.w.dx = 'T';
        rc = intdos( &in_regs, &out_regs );
        in_regs.w.dx = 'D';
        rc = intdos( &in_regs, &out_regs );
        in_regs.w.dx = 'O';
        rc = intdos( &in_regs, &out_regs );
        in_regs.w.dx = 'S';
        rc = intdos( &in_regs, &out_regs );
      }

Classification:
    DOS

Systems:
    DOS, Windows, Win386, DOS/PM

See Also:
    bdos, int386, int386x, int86, int86x, intdosx, intr, segread

See Also: bdos int386

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson