Question: Use the following skeleton code: pa 2 . txt darr Objective Write a recursive function that determines whether a string is a palindrome. Your program

Use the following skeleton code: pa2.txt darr
Objective
Write a recursive function that determines whether a string is a palindrome. Your program should take a string as input, then call the recursive
function. The program should print a message indicating whether the input is a palindrome.
Requirements and Specifications
Your input cannot be stored as a global variable at any point. This means you cannot store it at a data section address, even when accepting them
from scanf; they must be returned from scanf on the stack.
X19-X27 are global variables. You may not use X19-X27 in your recursive function. If you want, you may use X19-X27 in your main function. You can use
any registers you want to in your main function.
A recursion procedure requires:
Allocate stack space
Save the return address and argument on the stack
Recursively call procedure with BL
Unwind the stack by restoring the return address and arguments and deallocating stack memory
If the code is not recursive, i.e. uses a loop or a the equivalent of a cas(e)/(s)witch table, your score will be(20)/(100.)
Hints and Warnings
You must put the local values and return address on the stack before any bl call, and restore the argument and the return address after the bl call. ```
.section .data
input_prompt : .asciz "Input a string: "
input_spec : .asciz "%[^
]"
palindrome_spec : .asciz "String is a palindrome (T/F): %c
"
.section .text
.global main
# program execution begins here
main:
# branch to this label on program completion
exit:
mov x0,0
mov x8,93
svc 0
ret
```
Use the following skeleton code: pa 2 . txt darr

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 Programming Questions!