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:

void decodel (long *xp, long *yp, long *zp) xp in %rdi, yp in %rsi, zp in %rdx decode1: movq movq movq movq

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

1 Expert Approved Answer
Step: 1 Unlock

Reverse engineering is a good way to understand systems In this case w... View full answer

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 Computer Systems A Programmers Perspective Questions!