simplifie?
This commit is contained in:
parent
87f270494f
commit
bdd227f948
1 changed files with 8 additions and 14 deletions
|
@ -1,17 +1,11 @@
|
||||||
globals (res)
|
globals (res)
|
||||||
local compteur:
|
res <- copy 1;
|
||||||
compteur <- copy 5;
|
res <- mul res, 5;
|
||||||
res <- copy 1;
|
res <- mul res, 4;
|
||||||
|
res <- mul res, 3;
|
||||||
|
res <- mul res, 2;
|
||||||
|
res <- mul res, 1;
|
||||||
|
|
||||||
condition:
|
%rdi <- copy res;
|
||||||
jumpif lte compteur, 1 -> fin, boucle;
|
print_int();
|
||||||
|
|
||||||
boucle:
|
|
||||||
res <- mul res, compteur;
|
|
||||||
compteur <- sub compteur, 1;
|
|
||||||
jump condition;
|
|
||||||
|
|
||||||
fin:
|
|
||||||
%rdi <- copy res;
|
|
||||||
print_int();
|
|
||||||
end
|
end
|
||||||
|
|
Reference in a new issue