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:
what are the options?
reply in comment so i can help:)
the answer is D Voice commands
Answer:
b or c
Explanation:
Answer:
Incidental.
Explanation:
When a computer or digital device is used as a storage device or in the facilitation of an offense, it is argued to be incidental to the offense.
For instance, the list of customers used by human traffickers is considered to be generated through an incidental system.
Answer:
integer
Explanation: