.text .globl main main: # input the string # push each character onto the stack # pop chars from stack back into the buffer # print the reversed string .data str: .space 128 # character buffer
The first section of the program reads a line from the terminal in the usual way. To shorten the program, there is no user prompt.
Next, the stack is initialized. Null is pushed onto the stack. Later on, the stack will be popped until this null is encountered.
Fill in the blanks of the program.