Prototype of X86_64 migration

This commit is contained in:
Roman Venediktov 2024-01-30 18:16:44 +01:00
parent 3fdc3e7f2a
commit e77433e51c
21 changed files with 599 additions and 7165 deletions

View file

View file

@ -0,0 +1,10 @@
fun f (a, b, c, d, e) {
var i = d / b;
write (a);
write (b);
write (c);
write (d);
write (e)
}
f (1, 2, 3, 4, 5)

View file

View file

@ -0,0 +1,15 @@
fun f (a, b, c, d, e, f, g, h) {
var i = 9, j = 10;
write (a);
write (b);
write (c);
write (d);
write (e);
write (f);
write (g);
write (h);
write (i);
write (j)
}
f (1, 2, 3, 4, 5, 6, 7, 8)

View file

View file

@ -0,0 +1,18 @@
fun f (a, b, c, d, e, f, g, h) {
fun g (unit) {
var tmp1 = 1 + (1 + (1 + (1 + (1 + 1 + (1 + (1 + (1 + (1 + 1 + (1 + (1 + (1 + (1 + 1))))))))))));
var tmp2 = (((((((((((((1 + 1) + 1) + 1) + 1) + 1) + 1) + 1) + 1) + 1) + 1) + 1) + 1) + 1) + 1;
write (a);
write (b);
write (c);
write (d);
write (e);
write (f);
write (g);
write (h)
}
g
}
f (1, 2, 3, 4, 5, 6, 7, 8)(0)

View file

@ -0,0 +1,5 @@
1
2
3
4
5

View file

@ -0,0 +1,10 @@
1
2
3
4
5
6
7
8
9
10

View file

@ -0,0 +1,10 @@
1
2
3
4
5
6
7
8
9
10

View file

@ -1,4 +1,4 @@
> 0
0
15
15
1

Binary file not shown.

View file

@ -1,14 +0,0 @@
fun f (a,b,c,d,e,f,g,h,i,j) {
write(a);
write(b);
write(c);
write(d);
write(e);
write(f);
write(g);
write(h);
write(i);
write(j)
}
f (1,2,3,4,5,6,7,8,9,10)

View file

@ -10,8 +10,6 @@ fun fact (n) {
n := read ();
fun f () {}
for i := n, i >= 1, i := i-1 do
write (i);
write (fact (i))

View file

@ -9,14 +9,14 @@ fun sort (x) {
for i := 0, i<n, i := i+1 do
for j := i+1, j<n, j := j+1 do
if x[j] < x[i] then
y := x[i];
x[i] := x[j];
x[j] := y
y := x[i];
x[i] := x[j];
x[j] := y
fi
od
od;
x
x
}
n := read ();

View file

@ -1,5 +1,3 @@
var n;
fun sum (l) {
case l of
{} -> 0
@ -23,9 +21,7 @@ fun array_to_list (a) {
l
}
n := read ();
write (sum ({}));
write (sum ({1, 2, 3, 4, 5}));
write (sum (1:2:3:4:5:{}));
print_list (array_to_list ([1, 2, 3, 4, 5]))

View file

@ -1,19 +0,0 @@
#!/bin/bash
for i in {1..9}
do
make test00$i
done
for i in {0..9}
do
make test01$i
done
for i in {0..9}
do
make test02$i
done
make test034
make test036