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

17 lines
263 B
Text
Raw Normal View History

2023-12-31 15:32:46 +01:00
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