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: I think C Step by step explanation:
Answer:
0.444
Explanation:
Formula for slope = (X2 - X1)/(Y2 - Y1)
X1 =100
X2 = 500
Y1 = 1000
Y2 = 10000
Slope = (500 - 100)/(10000 - 1000)
=400/9000
=4/90
=0.04444
Number of bill(X axis) against sales (Y axis)
It stands for arithmetic logic unit
It's D because all of this are TRUE.