IT博客汇
首页
精华
技术
设计
资讯
扯淡
权利声明
登录
注册
[ASM] 递归计算阶乘
jacky_zz
发表于
2014-12-28 13:08:00
love
0
org 100h
jmp start
stack:
db
256
dup(
0
)
topofstack:
db
0
; add your code here
start:
mov ax, cs
mov ds, ax
mov ss, ax
mov sp, topofstack
mov ax,
0x0003
push ax
call f
pop ax
hlt
f:
push bp
push ax
mov bp, sp
mov ax, [bp
+
6
]
cmp ax,
0x0001
je exit
dec ax
push ax
call f
pop ax
mul [bp
+
6
]
exit:
mov [bp
+
6
], ax
pop ax
pop bp
ret
jacky_zz
2014-12-28 21:08
发表评论