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/03.retrolix
2023-12-31 15:40:23 +01:00

16 lines
263 B
Text

def fact ()
%rax <- copy 1;
boucle: jumpif lte %rdi, 1 -> fin, suite;
suite: %rax <- mul %rax, %rdi;
%rdi <- sub %rdi, 1;
jump boucle;
fin: ret;
end
globals (res)
%rdi <- copy 5;
fact();
res <- copy %rax;
%rdi <- copy res;
print_int();
end