繁体   English   中英

“div”命令在程序集中不起作用

[英]The "div" command doesn't work in Assembly

在我的代码中,一切都按预期工作,但在执行“div bx”命令后,它停止工作。 我在相同的代码中多次使用该命令,它运行良好(我在开始时写了 cwd)。 它发生在你身上吗? 怎么了? 这是代码的一部分:

    proc Reduction
mov dx,0
mov cx,0
mov ax,0
mov bx,0
mov cx, [sheerit]
tsim:
mov ax,0
mov ax,[sheerit]
mov [sheerit1],ax
mov ax,[number2]
mov [number22],ax
mov dx,0
mov ax,[sheerit1]
mov bx,[counter]

div bx
cmp dx,0
jne next
mov ax,[number22]
mov bx, [counter]
div bx
cmp dx,0
jne next
mov ax,[counter]
mov [big],ax
next:
add [counter],1
loop tsim
mov ax,0
mov bx,0
mov cx,0
mov dx,0
mov ax,[sheerit]
mov bx,[big]
; here it stopped working:
div bx
mov [sheerit1],ax
mov ax,0
mov bx,0
mov cx,0
mov dx,0
mov ax,[number2]
mov bx,[big]
div bx
mov [number2],ax
ret
endp Reduction
mov bx,[big] ; here it stopped working: div bx

如果此时big变量仍然为零,则会发生这种情况,如果在tsim循环中计数器从未转移到big ,则可能会发生这种情况。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM