;-----------------------------------------------------------------------------
; probe16.asm - check stack upon procedure entry
; Adapted from Visual Studio C runtime library
; Portions Copyright (c) Microsoft Corporation. All rights reserved.
;-----------------------------------------------------------------------------
.model flat
.code
extern __chkstk:near
__alloca_probe_16 proc public ; 16 byte aligned alloca
push ecx
lea ecx, [esp] + 8 ; TOS before entering this function
sub ecx, eax ; New TOS
and ecx, (16 - 1) ; Distance from 16 bit align (align down)
add eax, ecx ; Increase allocation size
sbb ecx, ecx ; ecx = 0xFFFFFFFF if size wrapped around
or eax, ecx ; cap allocation size on wraparound
pop ecx ; Restore ecx
jmp __chkstk
__alloca_probe_16 endp
end
Detected encoding: ASCII (7 bit) | 2
|