我为字符串比较制作了这个 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