Question: lc3 Your program should accept an ascii character string, terminated by a carriage return. Echo the characters as they are typed in, then, on a

lc3 Your program should accept an ascii character string, terminated by a carriage return. Echo the characters as they are typed in, then, on a new line, print out the string in reverse.

You MUST implement your program using a stack, by writing your own Push and Pop subroutines and calling them to do the work.

The test string will not be longer than 40 characters, and you are not responsible for handling more than that. You do not need to handle a stack overflow condition.

(Remember that following the style guidelines counts for 10 points.)

Please submit your .asm file and a screen shot of your program with a suitable test string.

Sample input:

Reverse This String

Desired Output:

gnirtS sihT esreveR

For 5% extra credit you can add this feature to your code: If user tries to enter more than 40 characters, stack overflow is detected by the PUSH subroutine and the message "stack overflow" is displayed after echoing the 40 characters entered before the stack overflow event.

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!