我一直在研究这个代码,它应该从num1中找到最大值,然后计算它的阶乘。然后它存储了因子'事实'
但似乎它一直在循环,并且它没有到达程序的末尾
如果有人能引导我解决这个问题,我会很感激...这就是代码
[ORG 0x100]
jmp start
num1: dw 6, 3, 5, 2, 8, 1, 4, 7
max: dw 0
fact: dw 0
max1: push ax
push bx
push cx
mov ax, [bx]
dec cx
again2: add bx, 2
cmp ax, [bx]
jg next
mov ax, [bx]
next: loop again2
mov [di], ax
pop cx
pop bx
pop ax
ret
f: push bp
mov bp,sp
push ax
push dx
cmp word[bp+4],1
je exit
sub sp,2
mov ax,[bp+4]
dec ax
push ax
call f
pop ax
mov dx,0
mul word[bp+4]
mov [bp+6],ax
jmp exit2
exit: mov word[bp+6],1
exit2: pop dx
pop ax
pop bp
ret 2
start: mov bx, num1
mov cx, 8
mov di, max
call max1
sub sp,2
push max
call f
pop ax
end: mov ax, 0x4c00 ;terminate program
int 0x21