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 I would greatly appreciate it. As stated it must be written using MIPS native instructions, no pseudo Instructions. No li or la instructions!! Will thumbs down if used. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!