|
|
1.1 ! root 1: #ifndef DOSEXTH ! 2: #define DOSEXTH ! 3: ! 4: RCSTART ! 5: ! 6: #ifdef __RAD32__ ! 7: ! 8: #ifdef __WATCOMC__ ! 9: #pragma pack(1) ! 10: #endif ! 11: ! 12: void* RADLINK AllocDOS(u16 para); ! 13: ! 14: void RADLINK FreeDOS(void* p); ! 15: ! 16: s32 RADLINK mem386(); ! 17: ! 18: void* RealToPtr(u32 seg, u32 ofs); ! 19: #pragma aux RealToPtr = "shl eax,4" "add eax,ebx" parm [EAX] [EBX]; ! 20: ! 21: #define SegToPtr(seg) ((void*)((u32)seg<<4)) ! 22: ! 23: void* RealPtrToPtr(void* RealPtr); ! 24: #pragma aux RealPtrToPtr = "shld ebx,eax,20" "and eax,0xffff" "and ebx,0xffff0" "add eax,ebx" parm [EAX] modify [EBX]; ! 25: ! 26: void* PtrToRealPtr(void* Ptr); ! 27: #pragma aux PtrToRealPtr = "shrd eax,ebx,20" "and ebx,0xf" "mov ax,bx" parm [EBX] modify [EBX EAX]; ! 28: ! 29: #define PtrToRealSeg(ptr) ((u16)((u32)ptr>>4)) ! 30: ! 31: typedef struct SimStructtag { ! 32: u32 edi; ! 33: u32 esi; ! 34: u32 ebp; ! 35: u32 reserved; ! 36: u32 ebx; ! 37: u32 edx; ! 38: u32 ecx; ! 39: u32 eax; ! 40: u16 flags; ! 41: u16 es,ds,fs,gs,ip,cs,sp,ss; ! 42: } SimStruct; ! 43: ! 44: #ifdef __RADWINEXT__ ! 45: ! 46: u32 WinGet16(void*p); ! 47: #pragma aux WinGet16 = \ ! 48: "mov ax,0" \ ! 49: "mov cx,1" \ ! 50: "int 031h" \ ! 51: "mov di,ax" \ ! 52: "mov ax,6" \ ! 53: "mov bx,ds" \ ! 54: "int 31h" \ ! 55: "shl ecx,16" \ ! 56: "mov cx,dx" \ ! 57: "add ecx,esi" \ ! 58: "mov dx,cx" \ ! 59: "shr ecx,16" \ ! 60: "mov ax,7" \ ! 61: "mov bx,di" \ ! 62: "int 31h" \ ! 63: "mov ax,8" \ ! 64: "mov cx,0" \ ! 65: "mov dx,64000" \ ! 66: "int 31h" \ ! 67: "shl ebx,16" \ ! 68: parm [ESI] \ ! 69: modify [EAX EBX ECX EDX EDI ESI] \ ! 70: value [ebx]; ! 71: ! 72: void WinFree16(void*p); ! 73: #pragma aux WinFree16 = \ ! 74: "mov ax,1" \ ! 75: "shr ebx,16" \ ! 76: "int 31h" \ ! 77: parm [ebx] \ ! 78: modify [ebx eax]; ! 79: ! 80: #else ! 81: ! 82: #define WinGet16 ! 83: #define WinFree16(p) ! 84: ! 85: #endif ! 86: ! 87: void RADLINK SimInt(u16 Int,SimStruct far*ss); ! 88: ! 89: #ifdef __WATCOMC__ ! 90: #pragma pack() ! 91: #endif ! 92: ! 93: #else ! 94: ! 95: #ifdef __WATCOMC__ ! 96: ! 97: u32 WinGet16(u32,u16 ds); ! 98: #pragma aux WinGet16 = \ ! 99: "mov ax,6" \ ! 100: "int 31h" \ ! 101: "add dx,si" \ ! 102: "adc di,cx" \ ! 103: "mov ax,0" \ ! 104: "mov cx,1" \ ! 105: "int 031h" \ ! 106: "mov bx,ax" \ ! 107: "mov ax,7" \ ! 108: "mov cx,di" \ ! 109: "int 031h" \ ! 110: "mov ax,8" \ ! 111: "mov cx,0" \ ! 112: "mov dx,64000" \ ! 113: "int 31h" \ ! 114: "mov dx,bx" \ ! 115: "xor ax,ax" \ ! 116: parm [DI SI] [BX] \ ! 117: modify [AX BX CX DX DI SI] \ ! 118: value [dx ax]; ! 119: ! 120: void WinFree16(void PTR4*p); ! 121: #pragma aux WinFree16 = \ ! 122: "mov ax,1" \ ! 123: "int 31h" \ ! 124: parm [bx ax] \ ! 125: modify [bx ax]; ! 126: ! 127: #endif ! 128: ! 129: #endif ! 130: ! 131: RCEND ! 132: ! 133: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.