0

Assembly help!!!

; factoral.asm ; My name is: (put your name here) .386 .model flat,stdcall .stack 4096 ExitProcess PROTO,dwExitCode:DWORD .code ; Recursive function to compute the factorial of eax. Saves the result into eax. ; Assumes eax is a positive integer. Factorial PROC ; todo: Something is wrong with this subroutine. Add 2 lines of code somewhere ; within this subroutine to make it work properly. cmp eax, 1 JE L1 mov ebx, eax dec eax call Factorial imul ebx L1: ret Factorial ENDP main PROC mov eax, 5 call Factorial INVOKE ExitProcess,0 ; if done correctly eax is equal to 120. main ENDP END main

23rd Apr 2020, 10:41 PM
Joe Elizalde
Joe Elizalde - avatar
1 Resposta
+ 1
Can you decribe the problem?
25th Apr 2020, 10:18 AM
Emre İRİŞ
Emre İRİŞ - avatar