Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions

Question

Is American Express liable to Gray for violating the FCBA?

Answered: 1 week ago

Question

Evaluate 3x - x for x = -2 Answer:

Answered: 1 week ago