data segment
str1 db 100
len1 db ?
db 100 dup(?)
str2 db 100
len2 db ?
db 100 dup(?)
inf1 db 0ah, 0dh, 'Input string1:','$'
inf2 db 0ah, 0dh, 'Input string2:','$'
inf3 db 0ah, 0dh, 'string1 = string2 ? '
judg db 20h, 20h, 20h, '$'
data ends
stack segment stack
db 200 dup(?)
stack ends
code segment
assume cs:code, ds:data, ss:stack
start:
mov ax, data
mov ds, ax
input:
lea dx, inf1
mov ah, 09h
int 21h
lea dx, str1
mov ah, 0ah
int 21h
lea dx, inf2
mov ah, 09h
int 21h
lea dx, str2
mov ah, 0ah
int 21h
judge:
mov al, len1
mov ah, len2
cmp ah, al
jnz NO
mov ch, 0
mov cl, al
mov si, 0
mov di, 0
next:
inc si
inc di
mov ah, len1[si]
cmp ah, len2[di]
jnz NO
loop next
mov judg, 'Y'
mov judg+1, 'E'
mov judg+2, 'S'
jmp final
NO:
mov judg, 'N'
mov judg+1, 'O'
mov judg+2, 20h
final:
lea dx, inf3
mov ah, 09h
int 21h
ret
code ends
end start