Question: Problem Description A palindrome is a sequence of characters (values) that reads the same forward as it does backward. Assignment Write an 8051 assembly language

Problem Description

A palindrome is a sequence of characters (values) that reads the same forward as it does backward.

Assignment

Write an 8051 assembly language program to determine if a sequence of values is a palindrome. The sequence to be checked will be stored at memory location 0x20 (see code below) and the length of the sequence will be stored in register R0. The result will be stored in register R1. If the sequence is a palindrome, R1 should hold a 1. If it is not, R1 should hold a 0. Even though you are given the lengths of the data to test your program may not assume a specific length. That is, your program must be written to handle any length of data using loops and indirect addressing. Use the following 4 start-up sequences to test your code. Note that these are four separate tests, you will run your program four separate times. The only changes to your code from one test to the next should be the changing of the given start-up code.

; TEST 1 Start-up code MOV 0x20 #0x01 MOV 0x21 #0x02 MOV 0x22 #0x03

MOV 0x23 #0x02 MOV 0x24 #0x01 MOV R0, #0x05 

; TEST 2 Start-up code MOV 0x20 #0x01 MOV 0x21 #0x02 MOV 0x22 #0x02

MOV 0x23 #0x01 MOV R0, #0x04 

; TEST 3 Start-up code MOV 0x20 #0x01 MOV 0x21 #0x02 MOV 0x22 #0x03

MOV 0x23 #0x04 MOV 0x24 #0x05 MOV R0, #0x05 

; TEST 4 Start-up code MOV 0x20 #0x01

MOV 0x21 #0x02 MOV 0x22 #0x03 MOV 0x23 #0x03 MOV R0, #0x04 

can you please provide me a clear explanation about it?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!