Write a program to do the following: Load $t0 with 12 and call it x. Load 21 in $t1 and denote it as y. Finally, load 32 in $t2 and refer to it as z. Now, compute 3x2 10y 5z. Output the result using syscall 1 (remember the result has to be in $a0). Write down the output number on your answer sheet.
1 answer:
Answer:
addi $t0, $zero, 12
addi $t1, $zero, 21
addi $t2, $zero, 32
addi $t3, $zero, 3
mul $t3, $t3, $t0
mul $t3, $t3, $t0
addi $v, $zero, 10
mul $v, $v, $t1
addi $w, $zero, 5
mul $w, $w, $t2
add $a0, $t3, $v
add $a0, $a0, $w
addi $v0, $zero, 1
syscall
Explanation:
Use the addi statement to initialize the t0, t1 and t2 variables with a 0 value. Use the mul statement to multiply the t0 with t3 and then multiply variable v with t1. Use the add statement to add the variable v with t3 and assign the result to a0 variable. Use the add statement to add the variable w with a0 and assign the result to a0 variable.
You might be interested in
Answer:
yes cuz 25x8=200
Explanation:
Answer:
sectors
Explanation:
hard disk contain tracks which are further divided into sectors, for storage purposes.
Answer:
oh for me there is maybe try reloading?
Explanation:
Answer:
blank 1: interrogation
blank 2: getting to know
Explanation:
Answer:
False
Explanation:
This statement is false because International human rights stores large database so its search functionality is not limited to the website.