Say it with a frame
Draw a box around one word read from input. For the input hello:
+------------+
| hello |
+------------+
The starter reads the word into word_buf and already holds the middle line's format string, fmt_mid. Add a border string to .data (a +, twelve -, a +), then print three lines: the border, the middle line, and the border again. One border string is enough; load its address into x0 a second time for the bottom line.
printf prints exactly the characters it is given and never adds a line break of its own, so the border string needs its own \n. In fmt_mid, %-10s is replaced by the string whose address is in x1, padded with spaces to 10 characters, which keeps the right edge in place for any word. The starter's scanf cuts a longer word to its first 10 characters.
What is checked
- with input
hellothe output is exactly the three lines above - the program exits cleanly
- the program also runs on words you do not see: one of exactly 10 letters, one longer than 10, and no word at all
specification
We run your program on the input above and on the hidden ones, and compare what it does. Nothing is matched against a stored solution.