Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Construct a program that will print out the data words in memory AS ASCII CHARAC

ID: 675406 • Letter: C

Question

Construct a program that will print out the data words in memory AS ASCII CHARACTERS in the reverse order that they are declared in the data statement. To do this, use the stack to reverse the data sequence. You will need two small loops: one to store the four data words on the stack, and a second to print the data (which is conveniently in reverse order on the stack!) to the console. Yes, you WILL need a counter in both loops! When addressing the stack, use the “points to the last filled location” convention for the stack pointer ($29). Note 1: In the first loop, use a counter to count up to 4; then count DOWN from 4 in the second loop. Note 2: If you pop each word off the stack into $a0, then execute a syscall 11, you will print out the least significant byte of the word as an ASCII character. End the program with a syscall 10.

Explanation / Answer

CODE :