RosettaCodeData/Task/Factorial/X86-Assembly/factorial-1.x86
2023-07-01 13:44:08 -04:00

11 lines
168 B
Text

global factorial
section .text
; Input in ECX register (greater than 0!)
; Output in EAX register
factorial:
mov eax, 1
.factor:
mul ecx
loop .factor
ret