Question
Q6 (5 pts.)- Prompt the user to input a number as declared with label com: in the data directive below. What instructions are needed for
Q6 (5 pts.)- Prompt the user to input a number as declared with label com: in the data directive below.
What instructions are needed for the appropriate syscall? la, syscall 4, syscall 1, syscall 5
Q7 (bonus 1pt) Write the SPIM instructions to prompt the user to input a number as declared with label com: in the data directive
MA
Q8 (5 pts.)- Read the input from the keyboard and move the data to register $t3.
What instructions are needed for the appropriate syscall? syscall 4, syscall 1, syscall 5, move
Q9 (bonus 1pt) Write the SPIM instructions to read the input from the keyboard and move that data to register $t3
Matching
Q10 (10 pts.)- Use lw instruction and the data declared in .data directive to load $t0, $t1, $t2 with data stored at address labels num1, num2, num3 respectively. What instructions are needed and what would be the actual content of destination registers $t0, $t1, $t2.
Match the lw instruction to the actual content in decimal of the corresponding destination register.
lw $t0, num1 = , lw $t1, num2 = , lw $t2, num3 =
MA
Q11 (5 pts.)- Multiply content of register $t0 by content of $t1 and put the result in $s0.
What instructions may be used? mul $s0, $t0, $t1 mul $s0, $t1, $t2 mul $t0, $t2, $s0, sw $s0, $t0x$t1
MA
Q12 (5 pts.)- Add 5 to [$s0] and put the result in $s0 and store it at address location labeled num4:
What instructions are needed? add $s0, $s0, 5, add $s0, 5, $s0, sw $s0, num4, sw $s0, $s0+5
MC
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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