47 lines
437 B
NASM
47 lines
437 B
NASM
format ms64 coff
|
|
|
|
section '.text' code readable executable align 16
|
|
|
|
use64
|
|
|
|
public _loop
|
|
_loop:
|
|
mov rax, rcx
|
|
@loop_loop:
|
|
mul rcx
|
|
nop
|
|
nop
|
|
nop
|
|
loop @loop_loop ; lol
|
|
ret
|
|
|
|
int3
|
|
int3
|
|
int3
|
|
int3
|
|
int3
|
|
int3
|
|
int3
|
|
int3
|
|
int3
|
|
int3
|
|
|
|
public _tail_recursion
|
|
_tail_recursion:
|
|
test ecx, ecx
|
|
je @is_0
|
|
mov eax, ecx
|
|
dec ecx
|
|
@loop:
|
|
test ecx, ecx
|
|
jz @tr_end
|
|
|
|
mul ecx
|
|
dec ecx
|
|
|
|
jnz @loop
|
|
jmp @tr_end
|
|
@is_0:
|
|
mov eax, 1
|
|
@tr_end:
|
|
ret |