试编写一程序:比较两个字符串 string1 和 string2 所含的字符是否相同,若相同
则显示‘match’; 否则,显示‘no match’
调用字处理程序 EDIT 建立以 sample.asm 文件
datarea segment
string1 db ‘move the cursor backward.’
string2 db ‘move the cursor backward.’
mess1 db ‘Match..’,13,10,”$’
mess2 db ‘No match!..’,13,10,”$’
datarea ends
prognam segment
main proc far
assume cs:prognam,ds:datarea,es:datarea
start:
push ds
sub ax,ax
push ax
mov ax,datarea
mov ds,ax
mov es,ax
lea si,string1
lea di,string2
cld
mov cx,25
repz cmpsb
jz match
lea dx,mess2
jmp short disp
match:
lea dx, mess1
disp:
mov ah,09
int 21h
ret
main endp
prognam ends
end start