-2
我將此8086彙編程序用於字符串比較,但它包含一個無限循環。我已檢查並重新檢查。任何人都可以找到我錯在哪裏?彙編程序中的無限循環
org 100
jmp start
str1: db "hello$"
str2: db "ello$"
start:
lea bx,str1
mov si,bx
lea ax,str2
mov di,ax
mov ax,1234
jmp compare
compare:
mov bl,[si]
cmp [di],bl
jne notequal
cmp bx,'$'
je equal
inc si
inc di
jmp compare
notequal:
mov ax,0000h
hlt
equal:
mov bx,0001h
hlt
ret
嚴重的是,使用調試器。 – 2012-04-30 18:22:34