tinyio.h
来自「开放源码的编译器open watcom 1.6.0版的源代码」· C头文件 代码 · 共 1,980 行 · 第 1/5 页
H
1,980 行
#define _XOR_BX_BX 0x31 0xdb
#define _XOR_CX_CX 0x31 0xc9
#define _XOR_DH_DH 0x30 0xf6
#define _XOR_DX_DX 0x31 0xd2
#define _XOR_DI_DI 0x31 0xff
#define _ADD_SP 0x83 0xc4
#define _XCHG_SI_DI 0x87 0xf7
#define _XCHG_BX_CX 0x87 0xd9
#define _MUL_BX 0xf7 0xe3
#define _MUL_CX 0xf7 0xe1
#define _RCL_DX_1 0xd1 0xd2
#define _ROR_DX_1 0xd1 0xca
#define _RCL_AX_1 0xd1 0xd0
#define _ROR_AX_1 0xd1 0xc8
#define _TEST_CL 0xf6 0xc1
#define _TEST_BL 0xf6 0xc3
#define _TEST_BH_BH 0x84 0xff
#define _JC 0x72
#define _JNC 0x73
#define _JZ 0x74
#define _JNZ 0x75
#define _JS 0x78
#define _JNS 0x79
#define _JMP_SHORT 0xeb
#define _INT 0xcd
#if (defined(__WINDOWS_386__) || defined(__OSI__) || defined(__CALL21__)) && !defined(__NOCALL21__)
extern void __Int21();
#define _INT_21 "call __Int21"
#else
#define _INT_21 _INT 0x21
#endif
#define _GET_ 0x00
#define _SET_ 0x01
#define _USE16 0x66 /* 16-bit override prefix (for 386) */
#define _SHR_ECX_N 0xc1 0xe9
#define _SHR_ESI_N 0xc1 0xee
#define _SHL_EAX_N 0xc1 0xe0
#define _SHL_EDX_N 0xc1 0xe2
#define _SHL_ECX_N 0xc1 0xe1
#define _SHL_EBX_N 0xc1 0xe3
#if defined(__386__)
#define _SET_DS_DGROUP
#define _SET_DS_DGROUP_SAFE
#define _RST_DS_DGROUP
#define _SET_DS_SREG
#define _SET_DS_SREG_SAFE
#define _RST_DS_SREG
#define _SREG
#elif defined( M_I86 )
#if defined( M_I86SM ) || defined( M_I86MM ) || defined( ZDP ) || defined( __WINDOWS__ )
#define _SET_DS_DGROUP
#define _SET_DS_DGROUP_SAFE
#define _RST_DS_DGROUP
#define _SET_DS_SREG _PUSH_DS \
_MOV_AX_ES \
_MOV_DS_AX
#define _SET_DS_SREG_SAFE _PUSH_DS \
_PUSH_ES \
_POP_DS
#define _RST_DS_SREG _POP_DS
#define _SREG es
#else
#define _SET_DS_DGROUP _PUSH_DS \
_MOV_AX_SS \
_MOV_DS_AX
#define _SET_DS_DGROUP_SAFE _PUSH_DS \
_PUSH_SS \
_POP_DS
#define _RST_DS_DGROUP _POP_DS
#define _SET_DS_SREG
#define _SET_DS_SREG_SAFE
#define _RST_DS_SREG
#define _SREG ds
#endif
#endif
#if defined( __386__ )
/***************************
* 80386 versions of pragmas
***************************/
#pragma aux _TinyCreatePSP = \
"pushfd" \
"mov ah,26h" \
"int 21h" \
"popfd" \
parm caller [dx] \
modify exact [ah];
#pragma aux _TinySetPSP = \
"pushfd" \
"mov ah,50h" \
"int 21h" \
"popfd" \
parm caller [bx] \
modify exact [ah];
#pragma aux _TinyCBAlloc = \
"mov eax,80004800h" \
_INT_21 \
"sbb ebx,ebx" \
"not ebx" \
"and eax,ebx" \
parm caller [ebx] \
value [eax] \
modify exact [eax ebx];
#pragma aux _TinyMemAlloc = \
"mov ah,48h" \
_INT_21 \
"sbb ebx,ebx" \
"not ebx" \
"and eax,ebx" \
parm caller [ebx] \
value [eax] \
modify exact [eax ebx];
#pragma aux _TinyDPMISegToSel = \
"mov ah,0" \
"mov al,2" \
"int 31h" \
"jnc L1" \
"xor ax,ax" \
"L1:" \
parm [bx] \
value [ax] \
modify exact [ax bx];
#pragma aux _TinyDPMICreateSel = \
"mov ah,0" \
"mov al,0" \
"int 31h" \
"jnc L1" \
"xor ax,ax" \
"L1:" \
parm [cx] \
value [ax] \
modify exact [ax];
#pragma aux _TinyDPMISetBase = \
"mov ecx,edx" \
"shr ecx,16" \
"mov ah,0" \
"mov al,7" \
"int 31h" \
"sbb eax,eax" \
parm [bx] [edx] \
value [eax] \
modify exact [eax ecx];
#pragma aux _TinyDPMISetLimit = \
"mov ecx,edx" \
"shr ecx,16" \
"mov ah,0" \
"mov al,8" \
"int 31h" \
"sbb eax,eax" \
parm [bx] [edx] \
value [eax] \
modify exact [eax ecx];
#pragma aux _TinyDPMISetRights = \
"mov ah,0" \
"mov al,9" \
"int 31h" \
"sbb eax,eax" \
parm [bx] [cx] \
value [eax] \
modify exact [eax];
#pragma aux _TinyDPMIGetDescriptor = \
"push es" \
"mov es,cx" \
"mov ah,0" \
"mov al,11" \
"int 31h" \
"sbb eax,eax" \
"pop es" \
parm [bx] [cx edi] \
value [eax] \
modify exact [eax];
#pragma aux _TinyDPMISetDescriptor = \
"push es" \
"mov es,cx" \
"mov ah,0" \
"mov al,12" \
"int 31h" \
"sbb eax,eax" \
"pop es" \
parm [bx] [cx edi] \
value [eax] \
modify exact [eax];
#pragma aux _TinyDPMICreateCSAlias = \
"mov ah,0" \
"mov al,10" \
"int 31h" \
"jnc L1" \
"xor ax,ax" \
"L1:" \
parm caller [bx] \
value [ax] \
modify exact [ax];
#pragma aux _TinyDPMIFreeSel = \
"mov ah,0" \
"mov al,1" \
"int 31h" \
"sbb eax,eax" \
parm caller [bx] \
value [eax] \
modify exact [eax];
#pragma aux _TinyDPMIRawPMtoRMAddr = \
"mov ah,3" \
"mov al,6" \
"xor edi,edi" \
"stc" \
"int 31h" \
"mov cx,si" \
"jnc L1" \
"xor cx,cx" \
"xor edi,edi" \
"L1:" \
value [cx edi] \
modify exact [eax cx si edi];
#pragma aux _TinyDPMIRawRMtoPMAddr = \
"mov ah,3" \
"mov al,6" \
"stc" \
"int 31h" \
"jnc L1" \
"xor ebx,ebx" \
"jmp short L2" \
"L1:" \
"shl ebx,16" \
"mov bx,cx" \
"L2:" \
value [ebx] \
modify exact [eax ebx cx si edi];
#pragma aux _TinyDPMISaveRMStateAddr = \
"mov ah,3" \
"mov al,5" \
"stc" \
"int 31h" \
"mov cx,si" \
"jnc L1" \
"xor cx,cx" \
"xor edi,edi" \
"L1:" \
value [cx edi] \
modify exact [ax bx cx si edi];
#pragma aux _TinyDPMISavePMStateAddr = \
"mov ah,3" \
"mov al,5" \
"int 31h" \
"jnc L1" \
"xor cx,cx" \
"xor ebx,ebx" \
"jmp short L2" \
"L1:" \
"shl ebx,16" \
"mov bx,cx" \
"L2:" \
value [ebx] \
modify exact [ax ebx cx si edi];
#pragma aux _TinyDPMISaveStateSize = \
"mov ah,3" \
"mov al,5" \
"int 31h" \
"jnc L1" \
"xor eax,eax" \
"L1:" \
value [ax] \
modify exact [eax bx cx si edi];
#pragma aux _TinyDPMISimulateRealInt = \
"push es" \
"mov es,dx" \
"mov ax,0x300" \
"int 31h" \
"sbb eax,eax" \
"pop es" \
parm caller [bl] [bh] [cx] [dx edi] \
value [eax] \
modify exact [eax bx cx edi];
#pragma aux _TinyDPMICallRealFarFrame = \
"push es" \
"mov es,dx" \
"mov ax,0x301" \
"int 31h" \
"sbb eax,eax" \
"pop es" \
parm caller [bh] [cx] [dx edi] \
value [eax] \
modify exact [eax bx cx edi];
#pragma aux _TinyDPMICallRealIntFrame = \
"push es" \
"mov es,dx" \
"mov ax,0x302" \
"int 31h" \
"sbb eax,eax" \
"pop es" \
parm caller [bh] [cx] [dx edi] \
value [eax] \
modify exact [eax bx cx edi];
#pragma aux _TinyDPMIGetProtectVect = \
"mov ah,2" \
"mov al,4" \
"int 31h" \
"jnc L1" \
"xor cx,cx" \
"xor edx,edx" \
"L1:" \
parm caller [bl] \
value [cx edx] \
modify exact [ax bx cx edx];
#pragma aux _TinyDPMISetProtectVect = \
"mov ah,2" \
"mov al,5" \
"int 31h" \
"sbb eax,eax" \
parm caller [bl] [cx edx] \
value [eax] \
modify exact [eax bx cx edx];
#pragma aux _TinyDPMIGetProtectExcpt = \
"mov ah,2" \
"mov al,2" \
"int 31h" \
"jnc L1" \
"xor cx,cx" \
"xor edx,edx" \
"L1:" \
parm caller [bl] \
value [cx edx] \
modify exact [ax bx cx edx];
#pragma aux _TinyDPMISetProtectExcpt = \
"mov ah,2" \
"mov al,3" \
"int 31h" \
"sbb eax,eax" \
parm caller [bl] [cx edx] \
value [eax] \
modify exact [eax bx cx edx];
#pragma aux _TinyDPMIAlloc = \
"mov ah,5", \
"mov al,1", \
"int 31h", \
"sbb eax,eax", /* eax=-1 if alloc failed */ \
"inc eax", /* eax=0 if alloc failed */ \
"je short L1",\
"mov ax,bx", /* linear address returned in BX:CX */ \
"shl eax,16",\
"mov ax,cx", \
"mov [eax],di", /* store handle in block */ \
"mov 2[eax],si",/* ... */ \
"L1:" \
parm caller [bx] [cx] \
value [eax] \
modify exact [eax ebx ecx esi edi];
#pragma aux _TinyDPMIRealloc = \
"mov di,[eax]" /* get memory block handle */\
"mov si,2[eax]" /* ... */\
"mov ah,5", \
"mov al,3", \
"int 31h", \
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?