Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please solve all the parts. You will need knowledge about the ARM Microcontroller. Thank you. AREA Mydata, DATA, READWRITE Num1 DCD 0x00030002 Num2 DCD 0x00020006,
Please solve all the parts. You will need knowledge about the ARM Microcontroller. Thank you.
AREA Mydata, DATA, READWRITE Num1 DCD 0x00030002 Num2 DCD 0x00020006, Num1 is at the memory location 0x0001 1000 Num2 is at the memory location 0x0001 1004 R13 = SP = 0x3000 0000 R14 = LR = 0xFFFF FFFF Initial conditions: RO = 0x0000 0002 R1 = OxAABB CCFE R2 = OxEEDD CCFC NZVC = 0000 AREA SUBROUTINE, CODE, READONLY CAL PROC ; instruction a PUSH (RO-R2 ; instruction b REPEAT LDRH R1,[SP,#0x12] ; instruction c LDRH R2, [SP,#OxOE] ; instruction d MUL R3, R2, R1 ; instruction e SUBS RO,#Ox01 ; instruction f LDRH R1,[SP,#0x10] ; instruction g LDRH R2, [SP,#OXOC] ; instruction h SDIV R6, R2,R1 ; instruction i POP {RO-R2} ; instruction BX LR ; instruction k ENDP AREA MAINPROGRAM, CODE, READONLY Memory location Label Instruction 0x0001 0000 START LDP 27,=Num1 Ox0001 0002 LDK 25,[R7],#0x04 0x0001 0006 STR R5 (SP,#-Ox04)! Ox0001 000A LDR R4,(R7) 0x0001 000C STR R4,(SP #-Ox04)! Ox0001 0010 BL CAL 0x0001 0014 STR R3.(SP1 Ox0001 0016 STR R6,(SP,#0x04! 0x0001 001A STOP B STOP Comments 1st instruction 2nd instruction 3rd instruction 4th instruction 5th instruction 6th instruction 7th instruction gth instruction gth instruction 0x0001 001C END a) Fill in the following memory block after the instruction 1 to instruction 5 are executed? [4 points) 0x2FFF FFF8 0x2FFF FFFA 0x2FFF FFFC 0x2FFF FFFE 0x3000 0000 XX - Don't care XX - Don't care b) What will be the value in R13 (word size hex format) after the instruction 5 is executed? (2 points) c) Fill in the following memory block after the instruction b is executed in the subroutine program? [6 points) 0x2FFF FFEC 0x2FFF FFEE Ox2FFF FFFO 0x2FFF FFF2 0x2FFF FFF4 0x2FFF FFF6 d) What will be the value in R13 (word size hex format) after the instruction bis executed? (2 points) e) What will be the value in R3 (word size hex format) after the instruction e is executed? [2 points) f) What will be the value in R6 (word size hex format) after the instruction i is executed? [2 points) 9) What will be the value in RO, R1, and R2 (word size hex format) after the instruction i is executed? (6 points) h) What will be the value in R14 (word size hex format) after the instruction 8 is executed? (2 points) AREA Mydata, DATA, READWRITE Num1 DCD 0x00030002 Num2 DCD 0x00020006, Num1 is at the memory location 0x0001 1000 Num2 is at the memory location 0x0001 1004 R13 = SP = 0x3000 0000 R14 = LR = 0xFFFF FFFF Initial conditions: RO = 0x0000 0002 R1 = OxAABB CCFE R2 = OxEEDD CCFC NZVC = 0000 AREA SUBROUTINE, CODE, READONLY CAL PROC ; instruction a PUSH (RO-R2 ; instruction b REPEAT LDRH R1,[SP,#0x12] ; instruction c LDRH R2, [SP,#OxOE] ; instruction d MUL R3, R2, R1 ; instruction e SUBS RO,#Ox01 ; instruction f LDRH R1,[SP,#0x10] ; instruction g LDRH R2, [SP,#OXOC] ; instruction h SDIV R6, R2,R1 ; instruction i POP {RO-R2} ; instruction BX LR ; instruction k ENDP AREA MAINPROGRAM, CODE, READONLY Memory location Label Instruction 0x0001 0000 START LDP 27,=Num1 Ox0001 0002 LDK 25,[R7],#0x04 0x0001 0006 STR R5 (SP,#-Ox04)! Ox0001 000A LDR R4,(R7) 0x0001 000C STR R4,(SP #-Ox04)! Ox0001 0010 BL CAL 0x0001 0014 STR R3.(SP1 Ox0001 0016 STR R6,(SP,#0x04! 0x0001 001A STOP B STOP Comments 1st instruction 2nd instruction 3rd instruction 4th instruction 5th instruction 6th instruction 7th instruction gth instruction gth instruction 0x0001 001C END a) Fill in the following memory block after the instruction 1 to instruction 5 are executed? [4 points) 0x2FFF FFF8 0x2FFF FFFA 0x2FFF FFFC 0x2FFF FFFE 0x3000 0000 XX - Don't care XX - Don't care b) What will be the value in R13 (word size hex format) after the instruction 5 is executed? (2 points) c) Fill in the following memory block after the instruction b is executed in the subroutine program? [6 points) 0x2FFF FFEC 0x2FFF FFEE Ox2FFF FFFO 0x2FFF FFF2 0x2FFF FFF4 0x2FFF FFF6 d) What will be the value in R13 (word size hex format) after the instruction bis executed? (2 points) e) What will be the value in R3 (word size hex format) after the instruction e is executed? [2 points) f) What will be the value in R6 (word size hex format) after the instruction i is executed? [2 points) 9) What will be the value in RO, R1, and R2 (word size hex format) after the instruction i is executed? (6 points) h) What will be the value in R14 (word size hex format) after the instruction 8 is executed? (2 points)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