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