1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| DATA SEGMENT STRING1 DB 'Move the cursor backword' YES DB 'Match',0AH,0DH,'$' NO DB 'No match',0AH,0DH,'$' COUNT EQU 24 DATA ENDS
EXTRA SEGMENT STRING2 DB 'Move the cursor backword' EXTRA ENDS
CODE SEGMENT ASSUME DS:DATA,CS:CODE,ES:EXTRA START: MOV AX,DATA MOV DS,AX MOV AX,EXTRA MOV ES,AX
LEA SI,STRING1 LEA DI,STRING2 MOV CX,COUNT REPZ CMPSB JNE FAULT OK: LEA DX,YES MOV AH,09H INT 21H JMP EXIT FAULT: LEA DX,NO MOV AH,09H INT 21H EXIT: MOV AH,4CH INT 21H CODE ENDS END START
|