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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started