This repository has been archived on 2024-01-18. You can view files and clone it, but cannot push or open issues or pull requests.
compilation/flap/questions/retrolixToX86_64/06.retrolix
2023-12-31 23:16:39 +01:00

28 lines
304 B
Text

def fact ()
local n:
n <- copy %rdi;
%rax <- copy 1;
condition:
jumpif lte n, 1 -> fin, boucle;
boucle:
%rax <- mul %rax, n;
n <- sub n, 1;
jump condition;
fin:
ret;
end
globals (x)
%rdi <- copy 5;
fact();
x <- copy %rax;
%rdi <- copy x;
observe_int();
exit;
end