Fill in the blanks for the following code data LL word 0x000
Fill in the blanks for the following code .data LL: .word 0x00000002, 0x10010018, 0xFFFFFFFE, 0x1001002, 0, 0, 0x00000006, 0, 0x00000007, 0, 0xFFFFFFFF, 0x10010000 head: .word 0x10010008 .text describe briefly, what does the above code do? describe briefly what does the code below do? lw $s1, head Loop: lw $s2, ($s1) beq $s2, 6. Found addi $s1, $s1, 4 beq $s1, 0, NotFound lw $s1, ($s1) j Loop Found: will this line be executed? why? NotFound: will this line be executed? why?
Solution
Answer of the first question :
lw $s0, head $s0 = 0x10010008
addi $s0,$s0,4 $s0 = 0x00000002
lw $s0,($s0) $s0 = 0x00000002 #it will store this adress to memory
addi $s0,s0,4 $s0 = 0x10010018
lw $s0, ($s0) $s0 = 0x10010018
