Question: For the next three questions, refer to this assembly program, and assume little endian. Note that each instruction takes 4 - bytes. Address | Code

For the next three questions, refer to this assembly program, and assume little endian. Note that each instruction takes 4-bytes.
Address | Code
0x00000000| main: MOVS R0, #0x3
0x00000004| BEQ end
0x00000008| loop: BL fun1
0x0000000C | CMP R0, #0x0
0x00000010| BGT loop
0x00000014| end: B end
0x00000018| fun1: SUB r0, #0x1
0x0000001C | PUSH {LR}
0x00000020| BL fun2
0x00000024| POP {LR}
0x00000028| BX LR
0x0000002C | fun2: MOV R8, #0x0000
0x00000030| MOVT R8, #0x2000
0x00000034| LSL R1, R0, #2
0x00000038| ADD R8, R1
0x0000003C | STR R0,[R8]
0x00000040| BX LR
Note: LSL means "Logical Shift Left." The line of code at address 0x34 is taking the value in R0, shifting the bits to the left 2 times, then placing the result in R1. Shifting to the left n times is the same as multiplying by 2^n.
(For this question, use the same code above)
Assume PC is currently set to: 0x00000008
On the next time step (in other words, after the instruction at PC =0x00000008 executes), what will the contents of the following registers be?
enter all 32 bits for each, written in hexadecimal with 0x included.
PC:
LR:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!