mirror of
https://github.com/anoma/juvix.git
synced 2024-12-12 14:28:08 +03:00
44 lines
476 B
Plaintext
44 lines
476 B
Plaintext
-- McCarthy's 91 function
|
|
|
|
function f91(integer) : integer {
|
|
push arg[0];
|
|
push 100;
|
|
lt;
|
|
br {
|
|
true: {
|
|
push 10;
|
|
push arg[0];
|
|
sub;
|
|
ret;
|
|
}
|
|
false: {
|
|
push 11;
|
|
push arg[0];
|
|
add;
|
|
call f91;
|
|
tcall f91;
|
|
}
|
|
};
|
|
}
|
|
|
|
function main() {
|
|
push 101;
|
|
call f91;
|
|
trace;
|
|
pop;
|
|
push 95;
|
|
call f91;
|
|
trace;
|
|
pop;
|
|
push 16;
|
|
call f91;
|
|
trace;
|
|
pop;
|
|
push 5;
|
|
call f91;
|
|
trace;
|
|
pop;
|
|
push void;
|
|
ret;
|
|
}
|