please use plptool5.2 to do this! .asm file is included in the screenshot in thi
ID: 3909093 • Letter: P
Question
please use plptool5.2 to do this! .asm file is included in the screenshot
in this project, you will be writing a program that receives a string of characters via the UART, checks if this string is a palindrome, and then uses a print function to print either “Yes” or “No”. A palindrome sequence of characters (typically a word or phrase) that is the same both forwards and backwards. For this project, strings will be terminated using a period (‘.’). You may assume that a string will contain at least one character in addition to a period. You will not need to handle empty strings or strings with only a period. Your program should be able to handle multiple strings sent one after another or concatenated together. For example, the string: “abba. data.” should print “Yes” followed by “No” on the next line. Spaces should be ignored when checking for a palindrome and the palindrome should not be case sensitive. For example, “A nut for a jar of tuna.” would be considered a palindrome.
A skeleton PLP project file is available to download on Blackboard. The PLP project includes a second ASM file titled, project3_print.asm. This ASM file contains the print function used in this project. PLPTool concatenates all ASM files within a PLP project into a single location in memory (unless additional .org statements have been added to specify different location for code). No changes to project3_print.asm should be made. When called, depending on the value in register $a0, the following string will be displayed on the simulated UART device’s output. If $a0 contains a zero then “No” will be displayed and if $a0 contains a non-zero value (e.g. one) then “Yes” will be displayed. The print function is called using the following instruction: call project3_print
main.asm smain program 1 org 0x10000000 |# Initializations 4 li $sp, 0x10fffffc |# Initialize any registers you will be using here # It can be helpful to include a comment about a register's purpose # next to an initialization at the start of the program for reference 10 12 j main 13 nop 14 15 |array-ptr: 16 17 18 19 main: 20 21 # Label pointing to 100 word array .space 100 # TODO: write your primary program within this loop main 23 nopExplanation / Answer
string is a palindrome or not :
palindrome.asm
DATA SEGMENT
MSG1 DB 10,13,'ENTER ANY STRING :- $'
MSG2 DB 10,13,'ENTERED STRING IS :- $'
MSG3 DB 10,13,'LENGTH OF STRING IS :- $'
MSG4 DB 10,13,'NO, STRING IS NOT A PALINDROME $'
MSG5 DB 10,13,'Yes, STRING IS A PALINDROME $'
MSG6 DB 10,13,'REVERSE OF ENTERED STRING IS :- $'
P1 LABEL BYTE
M1 DB 0FFH
L1 DB ?
P11 DB 0FFH DUP ('$')
P22 DB 0FFH DUP ('$')
DATA ENDS
DISPLAY MACRO MSG
MOV AH,9
LEA DX,MSG
INT 21H
ENDM
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START:
MOV AX,DATA
MOV DS,AX
DISPLAY MSG1
LEA DX,P1
MOV AH,0AH
INT 21H
DISPLAY MSG2
DISPLAY P11
DISPLAY MSG3
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.