DATA SEGMENT
S1 DB 'Please input string1: $'
S2 DB 'Please input string2: $'
S3 DB 'MATCH$'
S4 DB 'NO MATCH$'
S5 DB 10 DUP(?)
S6 DB 10 DUP(?)
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START: MOV AX,DATA ;put data to DS
MOV DS,AX
MOV ES,AX
LEA DX,S1 ;show message1
MOV AH,09H
INT 21H
LEA DX,S5 ;input string1
MOV AH,0AH
INT 21H
CALL CLRF
LEA DX,S2 ;show message2
MOV AH,09H
INT 21H
LEA DX,S6 ;input string2
MOV AH,0AH
INT 21H
CALL CLRF
mov si,0
ok: mov al,s5[si]
lea di,s6
mov cx,10
cld
lp: scasb
jz match
dec cx
jcxz lp
cmp si,10
inc si
jb ok
LEA DX,S4 ;show no match
MOV AH,09H
INT 21H
JMP FINISH ;go to finish
MATCH: LEA DX,S3 ;show info of match
MOV AH,09H
INT 21H
FINISH: MOV AH,4CH ;return to Dos
INT 21H
CLRF PROC NEAR
MOV DL,0DH ;cr
MOV AH,02H
INT 21H
MOV DL,0AH ;next line
MOV AH,02H
INT 21H
ret
CLRF ENDP
CODE ENDS
END START