ASSUME CS:CODE,DS:DATA
DATA SEGMENT
ORG 2000H
STRING DB “MPMC LAB$”
S_LENTH EQU $-STRING-1
MSG1 DB “THE GIVEN STRING IS A PALINDROME$”
MSG2 DB “THE GIVEN STRING IS NOT A PALINDROME$”
DATA ENDS
CODE SEGMENT
START: MOV AX,DATA
MOV DS,AX
LEA DX,MSG2
MOV CX,S_LENTH
LEA SI,STRING
MOV DI,SI
ADD DI,S_LENTH-1
SHR CX,1
BACK: MOV AL,[SI]
CMP AL,[DI]
JNZ NEXT
INC SI
DEC DI
LOOP BACK
LEA DX,MSG1
NEXT: MOV AH,09H
INT 21H
MOV AH,4CH
INT 21H
CODE ENDS
END START
Great man! Works like a charm
ReplyDeletepodei
DeleteHi Human, nice program
ReplyDeleteDoes it work on emulator software?
ReplyDelete