Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Compose a program to do the following: Using the li instruction, load $t0-$t3 as

ID: 675436 • Letter: C

Question

Compose a program to do the following: Using the li instruction, load $t0-$t3 as follows: $t0 = 22, $t1 = 15, $t2 = 7, $t3 = 18 Multiply register $t0 by $t1 and store the result in $s0. Multiply register $t2 by $t3 and store the result in $s1. Multiply $s0 by $s1 and store the result in $a0. After processing, output the contents of register $a0 to the console using the appropriate system call. End the program with syscall 10. You need NO data section, as there are no data declarations. What is the answer shown on the console in decimal?

Explanation / Answer

Program:

__start:
   li     $t0, 22
   li     $t1, 15
   li     $t2, 07
   li     $t3, 18
   mult    $s0, $t0, $t1
   mult    $s1, $t2, $t3
   li    $v0, 1 # system call code for print_decimal   
mult    $a0, $s0, $s1
   syscall
   li     $v0, 10 # terminate program run and
syscall # Exit
done

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote