RosettaCodeData/Task/Factorial/X86-Assembly/factorial-1.x86
2017-09-25 22:28:19 +02: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