Updated my stuff
authorSnafu <stuff@c-gabriel.at>
Sat, 8 May 2010 19:44:18 +0000 (21:44 +0200)
committerSnafu <stuff@c-gabriel.at>
Sat, 8 May 2010 19:44:18 +0000 (21:44 +0200)
codea/snafu_02.0
codea/snafu_02.call
codea/snafu_03.0
codea/snafu_03.call
codea/snafu_04.0 [new file with mode: 0644]
codea/snafu_04.call [new file with mode: 0644]

index 7871f2ef3d659c67e3f8e11f51075b242cb82558..5b796331ed9ad7ee26517cf714385c2607a6b87e 100644 (file)
@@ -5,3 +5,7 @@ end;
 method r(x y)
        return (x - y) - 10;
 end;
+
+method s(x y)
+       return 6 - (x - 1);
+end;
index 4e9d7491379afa80a279c8ee9bb42bdb5a388c88..a371164bf81261ff053b95b8fcbe97caf4b2a83f 100644 (file)
@@ -1,4 +1,5 @@
 extern long q(long this, long, long);
 extern long r(long this, long, long);
+extern long s(long this, long, long);
 
-RET((q(0xDEAD, 33, 15) == -10) && (r(0xDEAD, 33, 15) == 8));
+RET((q(0xDEAD, 33, 15) == -10) && (r(0xDEAD, 33, 15) == 8) && (s(0xDEAD, 33, 15) == -26));
index 8dbf0d9b2051c91170eceef87f5ee80217e5610d..c43ec47b09adaeb036b20d61b315cfa0728336ab 100644 (file)
@@ -1,3 +1,11 @@
 method Long(a b c d e)
        return (a - (e - 20)) - (b - (c - (99 - d)));
 end;
+
+method Loong(a b c d e)
+       return a - (b - (c - (d - (e - (a - (b - (c - (d - (e - 10)))))))));
+end;
+
+method Looong(a b c d e)
+       return (11 - a) - (22 - b) - (33 - c - (44 - d)) - (55 - (77 - e - -66));
+end;
index b39ff85d7b5a3e9b00a0ec099f28f6519ddfa54b..6fa61c04609f233e7ee1d54ae32077e11ba16931 100644 (file)
@@ -1,3 +1,4 @@
 long Long(long this, long, long, long, long, long);
 
-RET( Long(0xDEAD, 23, 66, 1024, 9999999, 65535) == 9935366 );
+RET( (Long(0xDEAD, 23, 66, 1024, 9999999, 65535) == 9935366) && (Loong(0xDEAD, 11, 22, 33, 44, 55) == 10) 
+       && (Looong(0xDEAD, 34, 92934, 2991, 12389, 72281) == 11309) );
diff --git a/codea/snafu_04.0 b/codea/snafu_04.0
new file mode 100644 (file)
index 0000000..6cc265b
--- /dev/null
@@ -0,0 +1,13 @@
+struct foo bar beef end;
+
+method foobar()
+       return foo.beef;
+end;
+
+method foobar2()
+       return this.bar;
+end;
+
+method foobar3()
+       return (233 - 31).beef;
+end;
diff --git a/codea/snafu_04.call b/codea/snafu_04.call
new file mode 100644 (file)
index 0000000..84cf59d
--- /dev/null
@@ -0,0 +1,14 @@
+long foobar(long);
+long foobar2(long);
+long foobar3(long);
+
+long tmp[] = {1111, 2222, 3333};
+/*
+asm(   "\tpush %%rax\n"
+       "\tmovq $42, %%rax\n"
+       "\tmovq %%rax, 218\n"
+       "\tpop  %%rax\n" :: );
+*/
+RET((foobar((long) tmp) == tmp[2]) 
+       && (foobar2((long) tmp) == tmp[1])); 
+       //&& (foobar3(0xDEAD) == 42));