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/07.retrolix

28 lines
321 B
Text
Raw Normal View History

2023-12-31 16:03:27 +01:00
def fact ()
local x:
jumpif lte %rdi, 1 -> fini, rec;
fini:
%rax <- copy 1;
ret;
rec:
x <- copy %rdi;
%rdi <- sub %rdi, 1;
fact();
%rax <- mul %rax, x;
ret;
end
globals (x)
x <- copy 5;
%rdi <- copy x;
fact();
x <- copy %rax;
%rdi <- copy x;
observe_int();
end