.MODEL SMALL
.DATA
STR1 DB "BBC"
LEN1 EQU $-STR1
STR2 DB ?
.CODE
MOV AX,@DATA
MOV DS,AX
LEA SI,STR1
MOV CX,LEN1
LEA DI,STR2
L1:
INC SI
LOOP L1
L2:
MOV AL,[SI]
MOV [DI],AL
DEC SI
INC DI
INC CX
CMP CX,LEN1
JNE L2
SUB DI,LEN1-1
MOV CX,LEN1
JMP L3
L3:
INC SI
INC DI
DEC CX
CMP CX,0
JE L5
MOV AL,[SI-1]
CMP AL,[DI-1]
JE L3
JNE L4
L4:
MOV AX,4C00H
INT 21H
L5:
MOV CX,10H ; IF THE STRING IS PALINDROME THAN 10 WILL BE MOVED TO CX
JMP L4
END