Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1) Assembly Programming a) Write the following C function in Assembly. You must follow the System V 64-bit calling convention and use AT&T Syntax notation.

image text in transcribed

1) Assembly Programming a) Write the following C function in Assembly. You must follow the System V 64-bit calling convention and use AT\&T Syntax notation. Note: You cannot change the algorithm in any way so your assembly function must still be recursive. (20 points) 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 $x 86-64$ calling convention passes function parameters in the registers $R C X$, RDX, R8 and R9 and returns values on register RAX. Caller saved registers are: RAX, RCX, RDX, R8, R9, R10 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 X8664 calling convention instead of the System $V$ 64-bit calling convention. (16 points) cs.vs. 1246||

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions