Question: Question 1 ( 4 points) Given the following program [00400000] 20110002 addi $17, $0, 2 [00400004] 20120003 addi $18, $0, 3 [00400008] 02328020 add $16,
![Question 1 ( 4 points) Given the following program [00400000] 20110002](https://s3.amazonaws.com/si.experts.images/answers/2024/09/66e01aa308ea5_91466e01aa282ca8.jpg)
![addi $17, $0, 2 [00400004] 20120003 addi $18, $0, 3 [00400008] 02328020](https://s3.amazonaws.com/si.experts.images/answers/2024/09/66e01aa3a378c_91566e01aa342cdc.jpg)


Question 1 ( 4 points) Given the following program [00400000] 20110002 addi $17, $0, 2 [00400004] 20120003 addi $18, $0, 3 [00400008] 02328020 add $16, $17, $18 ; 2: addi $si, $0, 2 ; 3: addi $s2, $0, 3 ; 4: add $so, $si, $s2 .text addi $s1, $0,2 addi $s2, $0,3 add $so, $s1, $s2 1) What will be the contents of the PC when the second instruction finishes? 2) Write the code of the third instruction? 3) What is the size of the memory? Question 2 ( 4 points) .data x: .word 3 y: .word 2 .text lw $50, x lw $sl, y sub $s2, $s0, $s1 sw $s2, x sw $50, y 1) What is the size of the variable x? 2) What is the final values of x and y at the end of the program? 3) If the address of x is 00101000, what will be the address of y? Question 3 (4 points) data x: .word 1, 5, 2, 8,3 sum: .word 0 .text la $0, x lw $t0, 12($s0) addi $s1,$t0,1 1) What will be the value of $s1 at the end of the program? 2) What is the smallest signed value that can be stored in 5 bits? 3) Complete the code of the last instruction is 0x2111 Question 4 (4 Points) .text addi $so, $0,7 sll $s1, $50, 1 andi $s2, $50,3 nor $s3, $so, $0 1) What will be the values of $s1, $s2, $s3 at the end of the program? Question 5 ( 3 Points) .text addi $50, $50,4 addi $s1, $s1,3 bne $so, $sl, yy addi $81, $s1, 2 j exit : addi $s0, $50, -2 exit: 1) What will be the value of $50, $sl at the end of the program? Question 6 (4 Points) .text addi $a0,0,3 jal xx addi $a0,$a0, 5 addi $a0,$a0, 2 addi Sa0,$a0,3 XX: jr $ra : Assume that the address of the first instruction is 0x00400000 1) What is the value in hex) that will be stored in Sra register when jal instruction is called? 2) What is the value in hex) that will be stored in PC when jal is executed? 3) What is the value (in hex) that will be stored in PC when jr instruction is executed? Question 7 (4 Points) data X: .word 0x23465127 text la $t0, x lb $s1, 2($t0) 1h $s2, 2($t0) What will be the values in $81, $s2 at the end of the program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
