|
Last change
on this file since 22012 was 9715, checked in by sandervl, 23 years ago |
|
Added wrappers for new & delete operators
|
|
File size:
2.3 KB
|
| Line | |
|---|
| 1 | ; $Id: odincrt.asm,v 1.6 2003-01-23 12:33:05 sandervl Exp $
|
|---|
| 2 |
|
|---|
| 3 | ;/*
|
|---|
| 4 | ; * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 5 | ; * Win32 Exception handling + misc functions for OS/2
|
|---|
| 6 | ; *
|
|---|
| 7 | ; * Copyright 1998 Sander van Leeuwen
|
|---|
| 8 | ; *
|
|---|
| 9 | ; */
|
|---|
| 10 |
|
|---|
| 11 | ; 1999/08/09 PH see if we can do this as INLINE functions
|
|---|
| 12 |
|
|---|
| 13 | .386p
|
|---|
| 14 | NAME odinfs
|
|---|
| 15 |
|
|---|
| 16 | CODE32 SEGMENT DWORD PUBLIC USE32 'CODE'
|
|---|
| 17 | ASSUME DS:FLAT, SS:FLAT
|
|---|
| 18 |
|
|---|
| 19 | PUBLIC __threadid
|
|---|
| 20 | __threadid proc near
|
|---|
| 21 | push ebp
|
|---|
| 22 | push fs
|
|---|
| 23 | mov ax, 150bh
|
|---|
| 24 | mov fs, ax
|
|---|
| 25 |
|
|---|
| 26 | mov eax,dword ptr fs:[0000000cH]
|
|---|
| 27 |
|
|---|
| 28 | pop fs
|
|---|
| 29 | mov ebp,esp
|
|---|
| 30 | leave
|
|---|
| 31 | ret
|
|---|
| 32 | __threadid endp
|
|---|
| 33 |
|
|---|
| 34 | PUBLIC __nw__FUiPCcT1
|
|---|
| 35 | EXTERN odin__debug_malloc:NEAR
|
|---|
| 36 | ;input: eax = size
|
|---|
| 37 | ; ecx = line nr
|
|---|
| 38 | ; edx = source filename
|
|---|
| 39 | __nw__FUiPCcT1 proc near
|
|---|
| 40 | push fs
|
|---|
| 41 | push eax
|
|---|
| 42 | mov ax, 150bh
|
|---|
| 43 | mov fs, ax
|
|---|
| 44 | pop eax
|
|---|
| 45 |
|
|---|
| 46 | sub esp, 0Ch
|
|---|
| 47 | call odin__debug_malloc
|
|---|
| 48 | add esp, 0Ch
|
|---|
| 49 |
|
|---|
| 50 | pop fs
|
|---|
| 51 | ret
|
|---|
| 52 | __nw__FUiPCcT1 endp
|
|---|
| 53 |
|
|---|
| 54 | PUBLIC __dl__FPvPCcUi
|
|---|
| 55 | EXTERN odin__debug_free:NEAR
|
|---|
| 56 | ;input: eax = this ptr
|
|---|
| 57 | ; ecx = line nr
|
|---|
| 58 | ; edx = source filename
|
|---|
| 59 | __dl__FPvPCcUi proc near
|
|---|
| 60 | push fs
|
|---|
| 61 | push eax
|
|---|
| 62 | mov ax, 150bh
|
|---|
| 63 | mov fs, ax
|
|---|
| 64 | pop eax
|
|---|
| 65 |
|
|---|
| 66 | sub esp, 0Ch
|
|---|
| 67 | call odin__debug_free
|
|---|
| 68 | add esp, 0Ch
|
|---|
| 69 | pop fs
|
|---|
| 70 | ret
|
|---|
| 71 | __dl__FPvPCcUi endp
|
|---|
| 72 |
|
|---|
| 73 |
|
|---|
| 74 | PUBLIC __nw__FUi
|
|---|
| 75 | EXTERN odin_malloc:NEAR
|
|---|
| 76 | ;input: eax = size
|
|---|
| 77 | __nw__FUi proc near
|
|---|
| 78 | push fs
|
|---|
| 79 | push eax
|
|---|
| 80 | mov ax, 150bh
|
|---|
| 81 | mov fs, ax
|
|---|
| 82 | pop eax
|
|---|
| 83 |
|
|---|
| 84 | sub esp, 4
|
|---|
| 85 | call odin_malloc
|
|---|
| 86 | add esp, 4
|
|---|
| 87 |
|
|---|
| 88 | pop fs
|
|---|
| 89 | ret
|
|---|
| 90 | __nw__FUi endp
|
|---|
| 91 |
|
|---|
| 92 | PUBLIC __dl__FPv
|
|---|
| 93 | EXTERN odin_free:NEAR
|
|---|
| 94 | ;input: eax = this ptr
|
|---|
| 95 | __dl__FPv proc near
|
|---|
| 96 | push fs
|
|---|
| 97 | push eax
|
|---|
| 98 | mov ax, 150bh
|
|---|
| 99 | mov fs, ax
|
|---|
| 100 | pop eax
|
|---|
| 101 |
|
|---|
| 102 | sub esp, 4
|
|---|
| 103 | call odin_free
|
|---|
| 104 | add esp, 4
|
|---|
| 105 |
|
|---|
| 106 | pop fs
|
|---|
| 107 | ret
|
|---|
| 108 | __dl__FPv endp
|
|---|
| 109 |
|
|---|
| 110 | PUBLIC GetFS
|
|---|
| 111 | GetFS proc near
|
|---|
| 112 | mov eax, fs
|
|---|
| 113 | ret
|
|---|
| 114 | GetFS endp
|
|---|
| 115 |
|
|---|
| 116 |
|
|---|
| 117 | PUBLIC SetFS
|
|---|
| 118 | SetFS proc near
|
|---|
| 119 | mov eax, [esp+4]
|
|---|
| 120 | mov fs, eax
|
|---|
| 121 | ret
|
|---|
| 122 | SetFS endp
|
|---|
| 123 |
|
|---|
| 124 |
|
|---|
| 125 | PUBLIC SetReturnFS
|
|---|
| 126 | SetReturnFS proc near
|
|---|
| 127 | push fs
|
|---|
| 128 | mov eax, [esp+8]
|
|---|
| 129 | mov fs, eax
|
|---|
| 130 | pop eax
|
|---|
| 131 | ret
|
|---|
| 132 | SetReturnFS endp
|
|---|
| 133 |
|
|---|
| 134 |
|
|---|
| 135 | PUBLIC RestoreOS2FS
|
|---|
| 136 | RestoreOS2FS proc near
|
|---|
| 137 | push 150bh ; @@@PH that's NOT the clean way ! :)
|
|---|
| 138 | mov ax, fs
|
|---|
| 139 | pop fs
|
|---|
| 140 | ret
|
|---|
| 141 | RestoreOS2FS endp
|
|---|
| 142 |
|
|---|
| 143 | CODE32 ENDS
|
|---|
| 144 | END
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.