Please explain this question steps by steps What is the value of $s1 in hex form
ID: 1766104 • Letter: P
Question
Please explain this question steps by steps
What is the value of $s1 in hex format after executing
the instruction lw $s1, 0xC($s0) ?
. What is the value of $s2 in hex format after executing the instruction lb $s2, 9($s0) ?
What is the value of $s3 in hex format after executing the instruction lbu $s3, 5($s0) ?
What is the value of $s4 after executing the instruction lh $s4, 6($s0) ?
If $t0 = 0xB069A580, what is the content of the memory array word in hex after executing the instruction? sw $t0, 8($s0)
The memory array shown is a big endian architecture, and starts at base address 0x20FA4200. The base address is stored in Ss0. Answer the followings Address 76 98 BO 2F 40 3F E7 89 A9 EF 78 C1 76 98 B0 2F 3F 4A D2 E5Explanation / Answer
Answer :- lw $s1, 0xC($s0) ; this will fill $s1 with a word value i.e. word at address (0x20FA4200 + 0xC) i.e. 0x20FA420C. So $s1 = 0x89E73F40 .
lb $s2, 9($s0) ; A byte is loaded from memory address (0x20FA4200 + 0x9) i.e from address 0x20FA4209. So $s2 = 0xFFFFFFEF . lb instruction perform sign extension. In 0xEF, we have MSB as 1, so it is copied to all higher bits, giving higher values as 0xFFFFFF.
lbu $s3, 5($s0) ; A byte is loaded from memory address 0x20FA4205 without signe extension. So $S3 = 0x00000098.
lh $s4, 6($s0) ; Load half word from memory 0x20FA4206 with sign extension. So $s4 = 0x00002FB0.
sw $t0, 8($s0) ; Store word 0xB069A580 to the address 0x20FA4208. So at address 0x20FA4208, 0xB069A580 is copied and prevoius data 0xC178EFA9 is no more in memory.