Question: Disassemble the following C function and annotate the assembly program (comment on what each line does). Note: the function argument xp is a pointer

Disassemble the following C function and annotate the assembly program (comment on what each line does). Note: the function argument xp is a pointer and you should be able to see how it is handled in assembly language. long exchange(long *xp, long y) { long x = *xp; *xp = y; return x; } Answer the following questions: 1. In what registers are the arguments xp and y passed? 2. How is the value in memory address pointed by xp referenced through the register that stores xp?
Step by Step Solution
There are 3 Steps involved in it
The disassembled C function along with annotations explaining each line of the assembly code exchang... View full answer
Get step-by-step solutions from verified subject matter experts
