Question: Write an LC-3 program (starting at memory location 0x3000) that checks if a string is hte reverse of another string... Please answer the question as
Write an LC-3 program (starting at memory location 0x3000) that checks if a string is hte reverse of another string...

Please answer the question as stated. These are old HW questions that I'm using to review for our final, so please show all of your work. Thanks!
Write an LC-3 program (starting at memory location 0x3000) that checks if a string is the reverse of another string. The end of the string is denoted by Your program should take both the strings as inputs from the keyboard. If the two strings are reverse of each other, you need to print "Y" to the screen, else you need to print "N" to the screen. In particular, your code should do the following things: a) Read an input character from the keyboard b) Test if the character is If the character is you successfully read the first string S1. c) Start reading input character from the keyboard again. d) Test if the character is If the character is you successfully read the second string S2. e) Compare the two input strings S1 and S2. If S2 is the reverse of si, display "Y" else display "N" NOTE: The size of the two input strings S1 and S2 can be different. If the sizes are different, S2 is clearly not the reverse of S1. You may assume the size of the input strings are always non-zero, and do not exceed 10. The output "Y" or "N" should be uppercase. Sample runs: Input: abcdaa# Input: abcdaa# Input: aadcba# Input: aaec# Ouput: Y Ouput: N Input: abcdaa# Input: aaecba# Ouput: N
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
