alloca.s
来自「MINIX系统源码」· S 代码 · 共 24 行
S
24 行
#
! alloca() - allocate space on the stack Author: Kees J. Bot
! 26 Jan 1994
#if __ACK__ /* BCC can't do alloca(), register saving is wrong. */
.text
.define _alloca
_alloca:
pop cx ! Return address
pop ax ! Bytes to allocate
add ax, #2*2+1 ! Add space for two saved register variables
andb al, #0xFE ! Align
mov bx, sp ! Keep current sp
sub sp, ax ! Lower stack
mov ax, sp ! Return value
push 2(bx) ! Push what is probably the saved si
push (bx) ! Saved di
! Now ACK can still do:
! pop di; pop si; mov sp, bp; pop bp; ret
push ax ! Dummy argument
jmp (cx)
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?