Question: Need help getting my assembly code to work it is supposed to print the factorial of a number. The C code I am trying to

 Need help getting my assembly code to work it is supposedto print the factorial of a number. The C code I amtrying to convert is the first picture, the second is the C

Need help getting my assembly code to work it is supposed to print the factorial of a number. The C code I am trying to convert is the first picture, the second is the C driver and the third is what I have so far. Note I am using a GCC compiler hence the %eax, %ecx, %ebx registers and %esp pointer register. etc. Also we use movl (to move register values) and addl and subl to add and subtract. and mull and divl to divide and multiply etc.

6.6-Assignment This is the specification of what the assembly functions need to perform. Do not copy or type this code. Use it as a reference when writing the assembly. This is a recursive implementation; do not write an iterative solution. /* begin specification code/ /* Convert the procedure exactly as given using local variables where needed. / int Factorial (int n) return 1i else( return n * Factorial (n-1); /* end specification code */ 6.6-Assignment This is the specification of what the assembly functions need to perform. Do not copy or type this code. Use it as a reference when writing the assembly. This is a recursive implementation; do not write an iterative solution. /* begin specification code/ /* Convert the procedure exactly as given using local variables where needed. / int Factorial (int n) return 1i else( return n * Factorial (n-1); /* end specification code */

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!