Question: Title: Recursion in x86-64 assembly code You are asked to use recursion to implement mul (multiplication of 2 numbers) function. In doing so, you must

Title: Recursion in x86-64 assembly code

You are asked to use recursion to implement mul (multiplication of 2 numbers) function. In doing so, you must use the stack (so we can get some practice), either by pushing/popping or by getting a section of it (e.g., subq $24, %rsp) and releasing it (e.g., addq $24, %rsp) at the end of your program. Yes, it is certainly possible to recursively implement mul without saving the values of the argument registers (edi and esi) onto the stack. However, for practice's sake, let's save them onto the stack as stated in the question.

Requirements:

mul: # performs integer multiplication

- when both operands are non-negative!

# x in edi, y in esi

# Requirements:

# - cannot use imul* instruction

# - you must use recursion (no loop) and the stack

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To implement a recursive multiplication function in x8664 assembly code using the stack we have to tackle the problem by breaking multiplication down ... 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 Databases Questions!