home *** CD-ROM | disk | FTP | other *** search
- /*
- * dos.h
- *
- * Defines the structures, unions, constants and function declarations
- * needed when using the DOS interface routines.
- *
- * Copyright (C) MicroWay, Inc., 1987, 1988, 1989
- *
- */
-
-
- struct DOUBLEREGS { /* Double-word registers. */
- unsigned long eax;
- unsigned long ebx;
- unsigned long ecx;
- unsigned long edx;
- unsigned long esi;
- unsigned long edi;
- unsigned long eflag;
- };
-
- struct WORDREGS { /* Word registers. */
- unsigned short ax, l_ax;
- unsigned short bx, l_bx;
- unsigned short cx, l_cx;
- unsigned short dx, l_dx;
- unsigned short si, l_si;
- unsigned short di, l_di;
- unsigned short cflag, l_cflag;
- };
-
-
-
- struct BYTEREGS { /* Byte registers. */
- unsigned char al, ah, l_al, l_ah;
- unsigned char bl, bh, l_bl, l_bh;
- unsigned char cl, ch, l_cl, l_ch;
- unsigned char dl, dh, l_dl, l_dh;
- unsigned long esi;
- unsigned long edi;
- unsigned char flag, lr_flag, rl_flag, ll_flag;
- };
-
-
- /* Union to overlay byte, word and doubleword register structures. */
-
- union REGS {
- struct DOUBLEREGS d;
- struct WORDREGS w;
- struct BYTEREGS b;
- };
-
-
-
-
- /* Exception handling function declarations. */
-
- unsigned stndpenv_(); /* Get environment information. */
- unsigned stndpsw_(); /* Get status word. */
- unsigned stndpcw_(); /* Get control word. */
- unsigned ldndpcw_(); /* Load new control word. */
- unsigned ndptype_(); /* Get NDP type. */
- void init_ndp_(); /* Initialize the NDP. */
- int set_ex_hdl_(); /* Set up exception handler. */
- void clrndpex_(); /* Clear NDP exception flags. */
- void ldndpenv_(); /* Restore environment information. */
-
-
- /* Structure declaration for 80387 NDP environmental information. */
-
- struct excep { /* For environmental information. */
- unsigned short cw;
- unsigned short l_cw; /* Padding. */
- unsigned short sw;
- unsigned short l_sw; /* Padding. */
- unsigned short tag;
- unsigned short l_tag; /* Padding. */
- unsigned ip_off;
- unsigned short cs_sel;
- unsigned short l_cs_sel; /* Padding. */
- unsigned data_off;
- unsigned short oper_sel;
- unsigned short l_oper_sel; /* Padding. */
-
- unsigned char st0[10];
- unsigned char st1[10];
- unsigned char st2[10];
- unsigned char st3[10];
- unsigned char st4[10];
- unsigned char st5[10];
- unsigned char st6[10];
- unsigned char st7[10];
- };
-
-
- /* Structure declaration for 80287 NDP environmental information. */
-
- struct excep287 { /* For environmental information. */
- unsigned short cw;
- unsigned short sw;
- unsigned short tag;
- unsigned short l_cw; /* Padding. */
- unsigned short l_sw; /* Padding. */
- unsigned short l_tag; /* Padding. */
- unsigned ip_off;
- unsigned short cs_sel;
- unsigned short l_cs_sel; /* Padding. */
- unsigned data_off;
- unsigned short oper_sel;
- unsigned short l_oper_sel; /* Padding. */
-
- unsigned char st0[10];
- unsigned char st1[10];
- unsigned char st2[10];
- unsigned char st3[10];
- unsigned char st4[10];
- unsigned char st5[10];
- unsigned char st6[10];
- unsigned char st7[10];
- };
-
-
- /* Structure declaration for Weitek NDP environmental information. */
-
- struct wexcep {
- unsigned short cw;
- unsigned short sw;
- union {
- unsigned regs[32];
- float f_regs[32];
- double d_regs[16];
- } u;
- };
-
-
-
- /* The following symbolic constants correspond to the
- * exception-handling bits in the Control Word of both
- * the 80x87 and the Weitek coprocessors. Because the
- * error bits in the Status Word are in the same
- * positions, the same values can be used for the
- * Status Word as well.
- */
-
- #define IM 1 /* All NDPs. */
- #define DM 2 /* 80x87 only */
- #define ZM 4 /* All NDPs. */
- #define OM 8 /* All NDPs. */
- #define UM 16 /* All NDPs. */
- #define PM 32 /* All NDPs. */
- #define UOM 64 /* Weitek only. */
- #define DCM 128 /* Weitek only. */
-
- #define _disable() asm("\tcli\n")
- #define _enable() asm("\tsti\n")
-