Question
Design a program that will prompt the user to enter two unsigned decimal numbers (integers). Each number will NOT exceed five digits. The program can
Design a program that will prompt the user to enter two unsigned decimal numbers (integers). Each number will NOT exceed five digits. The program can NOT ask the user how many digits will be entered. Both numbers must be stored in memory as NULL terminated strings. The first string must stored at the memory address 0x10000000. The second string must be stored at the address 0x10000020. The user should then be prompted to enter an operation. Valid operations are +, -, *, and a (for average). The result of the operation must be stored as an integer in register $v1 and displayed to the console in SPIM. When displaying the result, the output should be of the form, The expression evaluates to XXX where XXX is the numerical result. Assume the user will NOT enter commas when entering numbers larger than 999. The user must be prompted for user data, and instructions must be clearly displayed when your program runs. The native multiplication (mult, multu) and division (div, divu) instructions cannot be used in your program.
I have started writing some code below so if you can add onto it instead of writing your own from scratch I would greatly appreciate it. As stated it must be written using MIPS native instructions except you cannot use mult, multu, div, divu. no pseudo Instructions. No li or la instructions!! Will thumbs down if used so please don't waste your time if you are going to use pseudo Instructions. Thank you in advance.
.globl main
.text
main:
jal project2
add $0,$0,$0
jal project2
add $0,$0,$0
jal project2
add $0,$0,$0
addi $v0, $0, 10
syscall
# your TEXT section begins here
# your DATA section begins here
.data 0x10000000
.space 0x40
.asciiz " The expression evaluates to "
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