8051 Assembly Program Code to Check Palindrome Or Not - AT89C51 - Keil


The program is compiled in Keil for 8051 - AT89C51 in assembly language.

Program to check for palindrome,

Flowchart:-


Program:-

ORG 0000H
MOV DPTR,#MYDATA
MOV R2,#06H
MOV R3,#06H
MOV R1,#20H
MOV R0,#30H
LOOP: CLR A
MOVC A,@A+DPTR
MOV @R1,A
INC R1
INC DPTR
DJNZ R2,LOOP
DEC R1
LOOP 1: CLR A
MOV A,@R1
MOV @R0,A
DEC R1
INC R0
DJNZ R3,LOOP1
MOV R7,#06H
MOV R1,#20H
MOV R0,#30H
YES: MOV A,@R1 
MOV  B,@R0
CJNE A,B,NO
INC R1
INC R0
DJNZ R7,YES
CLR A
MOV A,#11H
MOV 40H,A
JMP HERE
NO: MOV A,#00H
MOV 40H,A
HERE : SJMP HERE
ORG 250H
MY DATA: DB "MALAYALAM"
END

Output:-



For more ASM programs - click here

Popular posts from this blog