Make an example program a bit more interesting

This commit is contained in:
Konstantin Nazarov 2024-12-07 20:02:32 +00:00
parent 23cf02cc38
commit 71bbc1e65d
Signed by: knazarov
GPG key ID: 4CFE0A42FA409C22
2 changed files with 10 additions and 5 deletions

View file

@ -39,4 +39,4 @@ As a result, you'll get an `example.raw` binary. To execute it:
./rve ../example/example.raw ./rve ../example/example.raw
``` ```
The expected output of the example program is `269`. The expected output of the example program is `40320`.

View file

@ -1,9 +1,14 @@
static int mem = 56; static int mem = 1;
int fact(int n) {
if (n == 0)
return 1;
return n * fact(n-1);
}
int main() { int main() {
int a = 42; mem = fact(8);
int b = 5;
mem = mem + a*b + 3;
return 0; return 0;
} }