Question: Q3 (6 points) Submitted Recursion in x8664 assembly code In this question, you are asked to rewrite the mul function you wrote in Assignment 4

Q3 (6 points) Submitted Recursion in x8664 assembly code In this question, you are asked to rewrite the mul function you wrote in Assignment 4 . This time, instead of using a loop, you are to use recursion. You must use the stack, either by pushing/popping or by getting a section of it, e.g.: subq \$factor_of_8, \%rsp and releasing it, e.g.,: addq \$factor_of_8, \%rsp at the end of your function. Use your files from Assignment 4: main.c, makefile and calculator. s. Keep the content of your calculator. sas is, i.e., keep the code of all the functions you dealt with in Assignment 4. Then copy the following and paste it over (replace) your entire mul function in calculator. s: 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 Then implement this recursive version of mul. While doing so, you must satisfy its new requirements. You must also satisfy the requirements below. - Your code must be commented such that others (i.e., TA's) can read your code and understand what each instruction does. - About comments: - Comment of Type 1: Here is an example of a useful comment: cmpl sedx, sr8d \# if j(sr8d)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
