home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
libcvers.zip
/
article_appendix
/
hcstack1.asm
< prev
next >
Wrap
Assembly Source File
|
2001-08-15
|
766b
|
41 lines
; $Id: hcstack1.asm,v 1.1.1.1 2001/08/14 23:34:32 root Exp $
;
; MetaWare stack routines - part 1
.386p
GRANULARITY EQU 1000h ; Stack checking granularity
PUBLIC __chkstk
_TEXT SEGMENT BYTE PUBLIC "CODE"
ASSUME cs:_TEXT ;, ds:STACK32, es:STACK32
__chkstk:
push ecx
mov ecx, esp
add ecx, 8
loc_18D6A:
cmp eax, GRANULARITY
jb loc_18D85
sub ecx, GRANULARITY
or dword ptr [ecx], 0
sub eax, GRANULARITY
jmp short loc_18D6A
; ───────────────────────────────────────────────────────────────────────────
loc_18D85: ; CODE XREF: cseg01:00018D6Fj
sub ecx, eax
or dword ptr [ecx], 0
mov eax, esp
mov esp, ecx
mov ecx, [eax]
mov eax, [eax+4]
jmp eax
_TEXT ENDS
END