Question
Topic is MIPS Assembly Language. Write a program that takes 5 characters as parameters to a function named reverse5 . You are to write your
Topic is MIPS Assembly Language.
Write a program that takes 5 characters as parameters to a function named reverse5.
You are to write your program with a main label that has programming logic to call reverse5.
You should write reverse5 to take 5 parameters.
Use these characters in the part of the program with the main label:
H, A, P, P, Y
These 5 characters are the 5 characters to pass to reverse5. The are to be arranged so that:
H is the first character parameter, A is the second character parameter. P is the third character parameter, P is the forth character parameter. Y is the fifth character parameter.
Each parameter must be a single character. None of the parameters are allowed to be strings.
reverse5 should do the following:
- pushes H on the stack first
- pushes A on the stack second
- pushes P on the stack third
- pushes P on the stack forth
- pushes Y on the stack fifth (last)
- prints each character before it is popped off of the stack
- pops the characters off the stack in the reverse order that the characters are placed on the stack. This means the characters should be printed and the stack popped in this order:
- print Y then pop
- print P then pop
- print P then pop
- print A then pop
- print H then pop for the last time
This means when reverse5 has returned to where it was called, the printing should output the characters to display in this way: YPPAH
Write comments in your program that state your name, the programming logic, and any details you feel you'd like to explain that state about how you are using the assembly language instructions.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started