doi
问题是即使dl
和bl
相等,它也不会跳跃。有谁知道为什么?
assume cs:code,ds:data
data segment
sir1 db "abc"
l1 equ $-sir1
sir2 db "a"
l2 equ $-sir2
bunbun db "Este!$"
nu db "NU este!$"
iesire db "Apasa Enter!$"
data ends
code segment
start:
mov ax,data
mov ds,ax
mov bp,offset sir1
mov si,offset sir2
dec bp
push bp
push si
mov ah,l1
mov bh,l2
unu:
pop si
pop bp
inc bp
dec ah
mov dl,sir1[bp]
mov bl,sir2[si]
push bp
push si
cmp dl,bl
je doi
cmp ah,0
je nu_bun
jmp unu
doi:
inc si
inc bp
dec ah
mov dl,sir1[bp]
mov bl,sir2[si]
cmp dl,bl
jne unu
cmp bh,0
je bun
jmp doi
bun:
mov dx,offset bunbun
mov ah,09h
int 21h
mov ah, 09h
mov dx,offset iesire
int 21h
mov ah, 0ah
int 21h
mov ax,4c00h
int 21h
nu_bun:
mov dx,offset nu
mov ah,09h
int 21h
mov ah, 09h
mov dx,offset iesire
int 21h
mov ah, 0ah
int 21h
mov ax,4c00h
int 21h
code ends
end start