Answered step by step
Verified Expert Solution
Question
00
1 Approved Answer
Write a function that adds the three numbers in $a 0 , $a 1 , $a 2 and prints something like: 2 + 7 +
Write a function that adds the three numbers in $a $a $a and prints something like: assuming that and were the values in a to a Your function should do the following: compute the sum of a a a and store it in t Print the value in a Print a Print the number in a Print a Print the value in a Print an Print the sum of the numbers that you put in t Print a linebreak Sample Output data plus : asciiz equal : asciiz linebreak : asciiz n text li $s li $s loopstart : beq $s $s loopend addi $s $s addi $s $s addi $s $s move $a $s # function args go in a to a move $a $s move $a $s jal printFun # then call our function j loopstart loopend : li $v syscall printFun : # your code goes down here
Write a function that adds the three numbers in $a $a $a and prints something like:
assuming that and were the values in a to a
Your function should do the following:
compute the sum of a a a and store it in t
Print the value in a
Print a
Print the number in a
Print a
Print the value in a
Print an
Print the sum of the numbers that you put in t
Print a linebreak
Sample Output
data
plus : asciiz
equal : asciiz
linebreak : asciiz n
text
li $s
li $s
loopstart :
beq $s $s loopend
addi $s $s
addi $s $s
addi $s $s
move $a $s # function args go in a to a
move $a $s
move $a $s
jal printFun # then call our function
j loopstart
loopend :
li $v
syscall
printFun :
# your code goes down here
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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