[英]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.