⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 alloca.s

📁 minux的源代码,一个非常小的操作系统
💻 S
字号:
#
!	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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -