Question: ( c ) Listing Q 3 a is the assembly language code for a version of the memcpy function commonly used in C programs. The

(c) Listing Q3a is the assembly language code for a version of the memcpy function commonly used in C programs. The function copies n bytes from the source location (src) to the destination location (dest).
a. What happens when each line of this function is executed?
[10 marks]
b. Identify an example of each of the following addressing modes in this function:
i. Immediate
ii. Register indirect
[4 marks]
c. If the stack pointer contains 0x20002000 on entry to this function, what address will the PUSH instruction save a copy of the link register to?
[2 marks]
d. You have a 32 byte block of data at memory address 0x20000100 that you would like to copy to address 0x20000200. How would you set up the registers and call upon this function to do this for you.
[6 marks]
e. How would you modify this function so that it returns the address of the destination buffer in R0.
[5 marks]
( c ) Listing Q 3 a is the assembly language code

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 Programming Questions!