1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-14 17:32:00 +03:00
juvix/tests/Asm/positive/test010.jva
2022-09-29 17:44:55 +02:00

25 lines
273 B
Plaintext

-- recursion
function sum(integer) : integer {
push arg[0];
push 0;
eq;
br {
true: push 0
false: {
push 1;
push arg[0];
sub;
call sum;
push arg[0];
add;
}
};
ret;
}
function main() {
push 1000;
tcall sum;
}