DATAS SEGMENT
STR1 DB "ABC"
STR2 DB "ABD"
COUNT EQU $ - STR2
D1 DB "MATCH$"
D2 DB "NOT MATCH$"
DATAS ENDS
CODES SEGMENT
ASSUME CS:CODES, DS:DATAS
START:
MOV AX, DATAS
MOV DS, AX
LEA SI, STR1
LEA DI, STR2
MOV CX, COUNT
LOOP1:
MOV AL, [SI]
CMP AL, [DI]
JNZ NNNN
INC SI
INC DI
LOOP LOOP1
NNNN:
CMP CX, 0
JNZ NO
LEA DX, D1
JMP DISP
NO: LEA DX, D2
DISP:
MOV AH, 9
INT 21H
MOV AH, 4CH
CODES ENDS
END START
DATAS SEGMENT
STR1 DB "ABC"
STR2 DB "ABD"
COUNT EQU $ - STR2
D1 DB "MATCH$"
D2 DB "NOT MATCH$"
DATAS ENDS
CODES SEGMENT
ASSUME CS:CODES, DS:DATAS
START:
MOV AX, DATAS
MOV DS, AX
LEA SI, STR1
LEA DI, STR2
MOV CX, COUNT
LOOP1:
MOV AL, [SI]
CMP AL, [DI]
JNZ NNNN
INC SI
INC DI
LOOP LOOP1
NNNN:
CMP CX, 0
JNZ NO
LEA DX, D1
JMP DISP
NO: LEA DX, D2
DISP:
MOV AH, 9
INT 21H
MOV AH, 4CH
INT 21H
CODES ENDS
END START