Question: 4 . ( 1 9 Points ) Consider the following assembly program, ` ` ` TITLE factorial INCLUDE Irvine 3 2 . inc . DATA
Points Consider the following assembly program,
TITLE factorial
INCLUDE Irvineinc
DATA
CODE
main PROC
xor edx,edx
push
call Factorial
pop ebx
mul ebx
call WriteDec
call Crlf
exit
main ENDP
; Calculate a factorial
Factorial PROC
push ebp
mov ebp,esp
mov eax,ebp
cmp eax,
ja L
mov eax,
pop ebp
ret
L:
dec eax
push eax
call Factorial
pop ebx
mul ebx ; EDX:EAX EAX EBX
pop ebp
ret
Factorial ENDP
END main
factorialasm
Answer the following questions based on the above 'factorial' program.
a Points Why STACK OVERFOW might occur in the above 'factorial' program?
ANSWER
b Points List the statements in line numbers specifying the terminating condition of the above 'factorial' program? What is the terminating condition of the above 'factorial' procedure?
ANSWER
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
