'int386x func'에 해당되는 글 1건

  1. 2021.07.03 Watcom C Library : int386, int386x, int86, int86x

 

 

Watcom C Library Reference : int386, int386x, int86, int86x

 

 

 

 

int386

 

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 the computer 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 CPU EAX register after the interrupt.

 

 

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

 


Example :

/* 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

 

 

 

 

 

int386x

 

Synopsis : #include <i86.h> 

              int int386x( int inter_no,

                           const union REGS *in_regs,

                           union REGS *out_regs,

                           struct SREGS *seg_regs );

 


Description : The int386x 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 32-bit C libraries and may be executed on Intel 386 compatible systems. Before the interrupt, the CPU registers are loaded from the structure located by in_regs and the DS, ES, FS and GS segment registers are loaded from the structure located by seg_regs.

 

All of the segment registers must contain valid values. Failure to do so will cause a segment violation when running in protect mode. If you don't care about a particular segment register, then it can be set to ( which will not cause a segment violation. The function segread can be used to initialize seg_regs to their current values.

 

Following the interrupt, the structure located by out_regs is filled with the contents of the CPU registers. The in_regs and out_regs structures may be located at the same location in memory. The original values of the DS, ES, FS and GS registers are restored. The structure seg_regs is updated with the values of the segment registers following the interrupt.


You should consult the technical documentation for the computer 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 CPU EAX register after the interrupt.

 

 

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

 


Example :

#include <stdio.h> 

#include <i86.h>


/* get current mouse interrupt handler address */
void main( )

{
    union REGS r;

    struct SREGS s;


    s.ds = s.es = s.fs = s.gs = FP_SEG( &s );


#if defined ( __PHARLAP__ )
    r.w.ax = 0x2503;         /* get real-mode vector */

    r.h.cl = 0x33;              /* interrupt vector 0x33 */

    int386( 0x21, &r, &r );

    printf( "mouse handler real-mode address=" "%lx\n", r.x.ebx ); 

    r.w.ax = 0x2502;         /* get protected-mode vector */

    r.h.cl = 0x33;             /* interrupt vector 0x33 */

    int386x( 0x21, &r, &r, &s );

    printf( "mouse handler protected-mode address=" "%x: %lx\n", s.es, r.x.ebx );


#else
    r.h.ah = 0x35;             /* get vector */

    r.h.al = 0x33;              /* vector 0x33 */

    int386x( 0x21, &r, &r, &s );

    printf( "mouse handler protected-mode address=" "%x:%lx\n", s.es, r.x.ebx);

#endif


}

 

Classification : Intel
Systems : DOS/32, QNX/32

 

 

 

 

 

int86

 

Synopsis : #include <i86.h> 

              int int86( int inter_no, const union REGS *in_regs, union REGS *out_regs );


Description : The int86 function causes the computer's central processor (CPU) to be interrupted with an interrupt whose number is given by inter_no. 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 the computer 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 CPU AX register after the interrupt.

 

 

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

 


Example :

/* 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/16, Win, QNX/16, DOS/PM

 

 

 

 

 

int86x

 

Synopsis : #include <i86.h> 

              int int86x( int inter_no,

                        const union REGS *in_regs,

                        union REGS *out_regs,

                        struct SREGS *seg_regs );


Description :  The int86x function causes the computer's central processor (CPU) to be interrupted with
an interrupt whose number is given by inter_no. Before the interrupt, the CPU registers are loaded from the structure located by in_regs and the DS and ES segment registers are loaded from the structure located by seg_regs.

 

All of the segment registers must contain valid values. Failure to do so will cause a segment violation when running in protect mode. If you don't care about a particular segment register, then it can be set to 0 which will not cause a segment violation. The function segread can be used to initialize seg_regs to their current values.

 

Following the interrupt, the structure located by out_regs is filled with the contents of the CPU registers. The in_regs and out_regs structures may be located at the same location in memory. The original values of the DS and ES registers are restored. The structure seg_regs is updated with the values of the segment registers following the interrupt.


You should consult the technical documentation for the computer 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 CPU AX register after the interrupt.

 

 

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

 


Example :

#include <stdio.h> 

#include <i86.h>


/* get current mouse interrupt handler address */


void main( )

{
    union REGS r;

    struct SREGS S;


    r.h.ah = 0x35;         /* DOS get vector */

    r.h.al = 0x33;         /* interrupt vector 0x33 */

    int86x( 0x21, &r, &r, &s );

    printf( "mouse handler address=%4.4x:%4.4x\n", s.es, r.w.bx );

}

 

Classification : Intel
Systems : DOS/16, Win, QNX/16, DOS/PM

 

 

 

 

 

 

 

 

This manual describes the WATCOM C library for DOS, Windows, and OS/2, It includes the Standard C Library (as defined in the ANSI C Standard).

 

WATCOM C Language Reference manual describes the ANSI C Programming language and extensions to it which are supported by WATCOM C/C++ (32bit)

 

 

 

 

 

728x90
반응형
Posted by 전화카드
,