Question: Q3. Consider the following ARMv8 assembly program, then answer the questions below: sum: sp, #16 STR Ox0000000080001228: Ox000000008000122C: Ox0000000080001230: Ox0000000080001234: Ox0000000080001238: Ox000000008000123C: Ox0000000080001240: Ox0000000080001244: Ox0000000080001248:

 Q3. Consider the following ARMv8 assembly program, then answer the questions

Q3. Consider the following ARMv8 assembly program, then answer the questions below: sum: sp, #16 STR Ox0000000080001228: Ox000000008000122C: Ox0000000080001230: Ox0000000080001234: Ox0000000080001238: Ox000000008000123C: Ox0000000080001240: Ox0000000080001244: Ox0000000080001248: Ox000000008000124c: SUB sp, STR x19, [sp, #8] x20, [sp] ADD x19, x1, x2 ADD x20, x19, x3 ADD x0, x20, XZR LDUR X19, [SP, #8] LDUR X20, [SP, #0] ADD sp, sp, #16 BR LR .global main main: MOV x1, #4 MOV x2, #5 0x0000000080001250: Ox0000000080001254: Ox0000000080001258: Ox000000008000125c: Ox0000000080001260: MOV x3, #20 BL sum ADD x0, x0, #2 i) At which address does the execution start? Why? 11) What value is stored in register LR after executing the instruction "BL sum? 111) Assuming that the initial value stored in sp is 0x00000000FEFFFFBO, What is the value of register sp (X28) after executing the instruction MOV x2, #5 and ADD x19, xl, x2? iv) Explain what the program is doing. Provide the C translation of the above assembly program. Q3. Consider the following ARMv8 assembly program, then answer the questions below: sum: sp, #16 STR Ox0000000080001228: Ox000000008000122C: Ox0000000080001230: Ox0000000080001234: Ox0000000080001238: Ox000000008000123C: Ox0000000080001240: Ox0000000080001244: Ox0000000080001248: Ox000000008000124c: SUB sp, STR x19, [sp, #8] x20, [sp] ADD x19, x1, x2 ADD x20, x19, x3 ADD x0, x20, XZR LDUR X19, [SP, #8] LDUR X20, [SP, #0] ADD sp, sp, #16 BR LR .global main main: MOV x1, #4 MOV x2, #5 0x0000000080001250: Ox0000000080001254: Ox0000000080001258: Ox000000008000125c: Ox0000000080001260: MOV x3, #20 BL sum ADD x0, x0, #2 i) At which address does the execution start? Why? 11) What value is stored in register LR after executing the instruction "BL sum? 111) Assuming that the initial value stored in sp is 0x00000000FEFFFFBO, What is the value of register sp (X28) after executing the instruction MOV x2, #5 and ADD x19, xl, x2? iv) Explain what the program is doing. Provide the C translation of the above assembly program

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!