字符串比较,显示结果
本人初学汇编,许多东东还不是很懂,希望大家帮忙下下比较两个字符串string1,string2.相同显示出‘match’,不同显示‘no match’
data segment
string1 db 'ling'
string2 db 'lingg'
EQUL db 'match$'
NOEQUL db 'no match$'
data ends
code segment
assume cs:code,ds:data
start:mov ax,data
mov ds,ax
mov bx,offset string1
mov dx,offset string2
REPZ CMPSB
JZ jump1
JNZ jump2
jump1:mov dx,offset EQUL
mov ah,09h
int 21h
jmp exit
jump2:mov dx,offset NOEQUL
mov ah,09h
int 21h
exit: mov ah,4ch
int 21h
code ends
end start