Question: You are given the following information. A function with prototype void decode1(long *xp, long *yp, long *zp); Is compiled into assembly code, yielding the following:
You are given the following information. A function with prototype
void decode1(long *xp, long *yp, long *zp);
Is compiled into assembly code, yielding the following:

Parameters xp, yp, and zp are stored in registers %rdi, %rsi, and %rdx, respectively. Write C code for decode1 that will have an effect equivalent to the assembly code shown.
void decodel (long *xp, long *yp, long *zp) xp in %rdi, yp in %rsi, zp in %rdx decode1: movq movq movq movq movq movq ret (%rdi), %r8 (%rsi), %rcx (%rdx), %rax %r8, (%rsi) %rcx, (%rdx) %rax, (%rdi)
Step by Step Solution
3.33 Rating (168 Votes )
There are 3 Steps involved in it
Reverse engineering is a good way to understand systems In this case w... View full answer
Get step-by-step solutions from verified subject matter experts
