Homework 2, Programming MadLib.
Short Description:
Write an assembly language program that plays a simple MadLib in x86 assembly using the ARM8 assembler on archimedes.
Goals
When you finish this homework, you should have:- Demonstrated your ability to do string input and output.
- Save strings in memory.
Formal Description
Write a program that will allow the user to play a game of MadLib with the following storyA [PHRASE 1: programming language] Adventure. For my big assignment, I decided to write the entire project in [PHRASE 1]. My program was supposed to [PHRASE 2: impressive verb phrase], but instead it yelled "[PHRASE 3: dramatic error message or exclamation]". It repeated this exactly [NUMBER 1] times before crashing spectacularly. After debugging for [NUMBER 2] straight minutes, I discovered I had accidentally deleted a semicolon. Boy is [PHRASE 1] a picky language!This story was designed and written by ChatGPT, but I messed with it a bit.
Your program should prompt for each of the identified phrases or numbers. It should store each of these in memory, then print the story. Please keep the format above, including newlines.
Make sure that:
- Your program includes identifying information such as your name and program number.
- You list any collaborators, human or AI
- Your code is well documented.
- Your code runs on archimedes
You should use the code files from our class.
You may use single word responses, or, if you wish, learn to use the system call read to handle input. This will allow you to use phrases that contain a space.
- The system call number, 63, should be stored in x8
- The stream should (0 for stdin) should be stored in x0
- The address of the location for the read should be in x1
- The maximum characters to read should be in x2
- After this
svc #0should be called - On return x0 will hold the number of bytes read.
- And the \n may be stored at the end of the string, so you maight want to replace this with 0
- Since we don't know branching and testing yet, you might clobber the last letter in a string if you do this wrong. Don't worry about that yet.