home *** CD-ROM | disk | FTP | other *** search
- include model
- cseg alloca_
- ;
- ; MetaWare Runtime Support: alloca.
- ; (c) Copyright 1989 MetaWare, Incorporated
- ; Entry:
- ; size to alloc
- ; return address <- SP
- ; Exit:
- ; alloc-ed space
- ; 4 bytes of junk
- ; since C will pop the 4 bytes of junk.
- ;
- public alloca
- alloca proc near
- mov edx,0[esp] ; Get return address
- mov eax,4[esp] ; Amount to alloc.
- add eax,3h ; Align to 4-byte boundary
- and al,0fch
- ; We don't do stack-limit checking, so
- sub esp,eax ; make sure you have the stack space available!
- mov eax,esp
- add eax,4 ;
- jmp edx ; return
- alloca endp
- endcseg alloca_
- end