Question: Q5 (10): Please write ARMv7 assembly program for following programs. Assume that variables are stored in memory and their addresses can be obtained by using




Q5 (10): Please write ARMv7 assembly program for following programs. Assume that variables are stored in memory and their addresses can be obtained by using ADR pseudo op? a = b*(c+2); i = 10; if (i>=j) {a = i+j;) else {a = 1;} a = a+2; for (i=10; i>5; i--) { int a = i + 2; int b = foo (a, 3) int c = b + 2; int d = foo (c, 5) } int foo(int a, int b) { int p = a*b; return p; Q4 (10): What are the values in registers R1, R2 and R3 at the end of this ARMv7 assembly program? MOV R1, #2 MOV R2, #10 MOV R3, #6 L1: CMP R1, R3 BGE L3 BL L2 ADD R1, R1, #2 BL1 L2: ADD R2, R2, #2 MOV R15, R14 L3: MUL R3, R1, R2 Q3 (10): What are the values in registers or memory at the end of following code? Please answer yourself before confirming using the ARM Simulator. MOV R1, #15 R1 = MOV R2, #22 R2 = CMP R1, R2 R3 ADDGT R1, R2, #10 R4 = MOV R4, #0x5000 MOV R2, #8 STR R2, [R4, #4] w MOV R2, #30 STR R2, (R4, #12]! MOV R2, #16 STR R2, (R4), #4 Memory Contents: Memory Address Values Q2 (10): What are the values in registers or memory at the end of following code? Please answer yourself before confirming using the ARM Simulator. MOV R1, #12 R1 = MOV R2, #24 R2 = AND R1, R2, #7 R3 = ORR R1, R2, #22 R4= EOR R1, R2, #12 BIC R3, R1, #18 MOV R4, R2, LSL #2 Have memory contents changed=? 01 (10): What are the values in registers or memory at the end of following code? Please answer yourself before confirming using the ARM Simulator. Code Results MOV R1, #30 R1 = MOV R2, #22 R2 = MOV R3, #35 R3 = IDD R1, R2, R3 SUB R2, R1, R3 CMP R1, #20 ADDLT R3, R1, # 10 SUBS R1, R1, R3 R1 = MUL R1, R1, R3 R2 = MOV R4, #6 R3 = R4 = MLA R2, R1, R3, R4 Have memory contents changed
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
