Created
December 1, 2016 15:52
-
-
Save kmjayadeep/eeacc30830eaaf5b0af88d10f7de9928 to your computer and use it in GitHub Desktop.
8051 program for checking palindrome
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mov dptr,#0000 | |
movx a,@dptr | |
mov r1,a | |
mov b,#0 | |
mov r0,#8 | |
loop: | |
rrc a | |
mov r1,a | |
mov a,b | |
rlc a | |
mov b,a | |
mov a,r1 | |
djnz r0,loop | |
movx a,@dptr | |
inc dptr | |
subb a,b | |
jz nott | |
mov a,#0 | |
jmp endpp | |
nott: mov a,#1 | |
movx @dptr,a | |
endpp: sjmp endpp | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How can we find the output that the given number is palindrome or not ?