Question: Modify your First MIPS Program ( or start from scratch ) to do the math shown below. Open a new file in MARS called SecondMIPSProgram.asm

Modify your First MIPS Program (or start from scratch) to do the math shown below.
Open a new file in MARS called SecondMIPSProgram.asm
Write a program that does the following math
x =(73)+(5+2)
Make sure you store the results in $t4.
Hint: You may need to use other registers besides $t0, $t1 and $t2. Maybe...
Once it runs, document it well and upload it to Canvas under the SecondMIPSProgram.asm. Please make sure to attach it as a .asm file.
Note: All values are hardcoded. And nothing is displayed on the screen. Just need to verify that the correct value ends up in $t4
# File Name: SecondMipsProgram.asm
# Name: You
# Date: Day written
# Description/Purpose: This program performs the following equation.
# x =(A - B)+(C + D)
# This is going to take three steps
# First, (A-B)
# Then (C+D)
# Then add the results.
.text
.globl main
main:
addi $t0, $zero, 7 # A - Load hard coded values (called immediate value) into $t0, $t1, $t2 and $t3
addi $t1, $zero, 3 #B
addi $t2, $zero, 5 #C
addi $t3, $zero, 2 #D
# Write your code here to do the math
# Make sure to exit cleanly
li $v0,10
syscall

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!