Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial And Temporal Databases 10th International Symposium Sstd 2007 Boston Ma Usa July 2007 Proceedings Lncs 4605

Authors: Dimitris Papadias ,Donghui Zhang ,George Kollios

2007th Edition

3540735399, 978-3540735397

More Books

Students also viewed these Databases questions

Question

What does stickiest refer to in regard to social media

Answered: 1 week ago