Question: a) Write the following C function in Assembly. You must follow the System V 64-bit calling convention and use AT&T Syntax notation. long fibonacci (long

a) Write the following C function in Assembly. You must follow the System V 64-bit calling convention and use AT&T Syntax notation. long fibonacci (long n) { if (n == 0) return 0; else if (n == 1) return 1; else return (fibonacci (n - 1) + fibonacci (n - 2)); } b) The Windows x86-64 calling convention passes function parameters in the registers RCX, RDX, R8 and R9 and returns values on register RAX. Caller saved registers are: RAX, RCX, RDX, R8, R9, R100 and R11, while callee-saved registers are RBX RBP, RDI, RSI, RSP, R12, R13, R14, and R15. Rewrite the assembly function from Part A using the Windows x86-64 calling convention instead of the System v 4- bit calling convention
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
