This commit is contained in:
Mylloon 2023-12-31 15:59:53 +01:00
parent 2b7de0b06b
commit ccf1f51a75
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

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