⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 strucs.inc

📁 开放源码的编译器open watcom 1.6.0版的源代码
💻 INC
📖 第 1 页 / 共 2 页
字号:
;------------------------------------------------------------------------------
;
;Some equates to make stacked register access simpler.
;
Int_EDI equ     0
Int_DI  equ     0
Int_ESI equ     4
Int_SI  equ     4
Int_EBP equ     8
Int_BP  equ     8
Int_ESP equ     12
Int_SP  equ     12
Int_EBX equ     16
Int_BX  equ     16
Int_BL  equ     16
Int_BH  equ     17
Int_EDX equ     20
Int_DX  equ     20
Int_DL  equ     20
Int_DH  equ     21
Int_ECX equ     24
Int_CX  equ     24
Int_CL  equ     24
Int_CH  equ     25
Int_EAX equ     28
Int_AX  equ     28
Int_AL  equ     28
Int_AH  equ     29
Int_GS  equ     32
Int_FS  equ     36
Int_ES  equ     40
Int_DS  equ     44
Int_Off equ     48
Int_Seg16       equ     50
Int_Seg32       equ     52
Int_Flags16     equ     52
Int_Flags32     equ     56


ResSize equ     4096            ;Size of resource block.
ResHead equ     16              ;Size of main header.
ResNum  equ     ((((4096-ResHead)/5) shr 2) shl 2)      ;Number of entries.
ResCount        equ     ResNum-4                ;count for free entry checking.

Res_NULL        equ     0       ;MUST be zero.
Res_PSP equ     1       ;single entry.
Res_SEL equ     2       ;single entry.
Res_MEM equ     3       ;3 entries.
Res_LOCK        equ     4       ;2 entries.
Res_DOSMEM      equ     5       ;?
Res_CALLBACK    equ     6       ;3 entries.
Res_NOTHING     equ     254
Res_CHAIN       equ     255     ;single entry.



MEM_FREE        equ     0       ;Free page.
MEM_START       equ     1       ;Used page, start of block.
MEM_END equ     2       ;Used page, end of block.
MEM_MASK        equ     3
;
MEM_LOCK        equ     4       ;Start of lock count.
MEM_LOCK_MASK   equ     15      ;4 bit lock count.
MEM_LOCK_SHIFT  equ     2
;
MEM_PHYS        equ     32      ;physical mapping.
;
MEM_FILL        equ     (MEM_LOCK_MASK shl MEM_LOCK_SHIFT)+MEM_START


;; MED 02/16/96
MaxCallBacks            equ     32+3            ;maximum number of call back table entries.
;MaxCallBacks           equ     32+4            ;maximum number of call back table entries.

;; MED increased 512 to 1024, 12/05/95
IFDEF BIGSTACK
RawStackDif             equ     5*1024          ;size of interrupt stacks.
ELSE
;RawStackDif            equ     1280            ;size of interrupt stacks.
RawStackDif             equ     1024            ;size of interrupt stacks.
;RawStackDif            equ     512             ;size of interupt stacks.
ENDIF

IFDEF BIGSTACK
RawStackTotal   equ     (10*RawStackDif)+RawStackDif
ELSE
;RawStackTotal  equ     8192+512
RawStackTotal   equ     8192+RawStackDif
;RawStackTotal  equ     (16*RawStackDif)+RawStackDif
ENDIF

tPL2StackSize   equ     4               ;other priveledge level stacks. never used.
tPL1StackSize   equ     4
tPL0StackSize   equ     256             ;Interupt catcher stack.


GDTNul          equ     00h                     ;Null entry.
;
VCPI_0          equ     08h                     ;blank entries for VCPI to fill in.
VCPI_1          equ     10h                     ;/
VCPI_2          equ     18h                     ;/
;
KernalTS                equ     20h+3                   ;Kernal TSS
KernalCS0               equ     28h                     ;Kernal PL0 code seg.
KernalPL0               equ     30h                     ;PL0 stack.
KernalSwitchPL0 equ     38h                     ;Mode switch PL0 stack.
Kernal40h               equ     40h+3                   ;DOS/BIOS data area access.
KernalPL3_2_PL0 equ     48h+3                   ;PL3 to PL0 call gate.
;
KernalLDT               equ     50h+3
KernalCS                equ     58h+3                   ;Kernal CS
KernalDS                equ     60h+3                   ;Kernal DS
KernalSS                equ     68h+3                   ;Kernal SS
KernalZero              equ     70h+3                   ;Kernal 0-4G data referance.
;
MainCS          equ     78h+3                   ;Main code seg.
MainDS          equ     80h+3                   ;Main data seg.
MainSS          equ     88h+3                   ;Main stack seg.
MainPSP         equ     90h+3                   ;PSP segment.
MainEnv         equ     98h+3                   ;Enviroment segment.
;
InitCS          equ     0a0h+3          ;Init code seg.
InitCS0         equ     0a8h                    ;Init code seg at PL0.
InitDS          equ     0b0h+3          ;Init data seg.
InitPL3_2_PL0   equ     0b8h+3
;
DpmiEmuCS               equ     0c0h+3          ;DPMI emulator code seg.
DpmiEmuCS0              equ     0c8h                    ;DPMI emulator code seg at PL0.
DpmiEmuDS               equ     0d0h+3          ;DPMI emulator data seg.
DpmiEmuPL3_2_PL0        equ     0d8h+3
;
GDTData         equ     0e0h+3
;
GDT_Entries             equ     0f0h/8          ;GDT entries to allocate.
;
KernalB000              equ     0b000h+3
KernalB800              equ     0b800h+3
KernalA000              equ     0a000h+3

;
CallBackStruc   struc
CallBackFlags   db ?
CallBackNum             db ?
CallBackOff             dw ?
CallBackProt            df ?
CallBackRegs            df ?
CallBackReal            dd ?
CallBackStackSel        dw ?
                dw ?
CallBackStruc   ends
;
Desc            struc
Limit           dw 0            ;Offset of last byte.
Base_l          dw 0            ;Low 16 bits of 32-bit address.
Base_m          db 0            ;Bits 16-23 of base.
Access          db 0            ;Access privaledge level.
Gran            db 0            ;Granularity and limit.
Base_H          db 0            ;bits 24-31 of base.
Desc            ends

DescPresent             equ     1 shl 7 ;Segment is present.
Desc32Bit               equ     1 shl 6 ;Segment is 32 bit (not 16!).
DescAvailable   equ     1 shl 4 ;Available for our use.
;
DescPL0         equ     0 shl 5 ;PL0
DescPL1         equ     1 shl 5 ;PL1
DescPL2         equ     2 shl 5 ;PL2
DescPL3         equ     3 shl 5 ;PL3
;
DescMemory              equ     1 shl 4 ;Segment is memory (not system gate etc.)
;
DescRData               equ     0       ;Read only data segment. (eg, ROM)
DescRWData              equ     2       ;Read/Write data.
DescRDataDown   equ     4       ;Read only expand down data segment.
DescRWDataDown  equ     6       ;Read/write expand down data segment.
DescECode               equ     8       ;Execute only code.
DescERCode              equ     10      ;Execute/read code.
DescECCode              equ     12      ;Execute only conforming code.
DescERCCode             equ     14      ;Execute/read conforming code.
;
Desc286Tss              equ     1       ;Available 286 TSS.
DescLDT         equ     2       ;LDT.
Desc286TssB             equ     3       ;Busy 286 TSS.
Desc286Call             equ     4       ;286 call gate.
DescTssGate             equ     5       ;TSS gate.
Desc286Int              equ     6       ;286 interupt gate.
Desc286Trap             equ     7       ;286 trap gate.
Desc386Tss              equ     9       ;Available 386 TSS.
Desc386TssB             equ     11      ;Busy 386 TSS.
Desc386Call             equ     12      ;386 call gate.
Desc386Int              equ     14      ;386 interupt gate.
Desc386Trap             equ     15      ;386 trap gate.


;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
v86CallStruc            struc
v86CallEDI              dd ?
v86CallESI              dd ?
v86CallEBP              dd ?
                dd ?
v86CallEBX              dd ?
v86CallEDX              dd ?
v86CallECX              dd ?
v86CallEAX              dd ?
v86CallFlags            dw ?
v86CallES               dw ?
v86CallDS               dw ?
v86CallFS               dw ?
v86CallGS               dw ?
v86CallIP               dw ?
v86CallCS               dw ?
v86CallSP               dw ?
v86CallSS               dw ?
v86CallStruc            ends
;


;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
TSSFields               struc
;
;Task segment structure.
;
Back            dw 0            ;Back link to any previous TSS.
                dw 0            ;Reserved.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -