From 34a5f2246b3e9b5dc7292f004edefb77f5951bf4 Mon Sep 17 00:00:00 2001 From: Snafu Date: Sat, 8 May 2010 21:44:18 +0200 Subject: [PATCH] Updated my stuff --- codea/snafu_02.0 | 4 ++++ codea/snafu_02.call | 3 ++- codea/snafu_03.0 | 8 ++++++++ codea/snafu_03.call | 3 ++- codea/snafu_04.0 | 13 +++++++++++++ codea/snafu_04.call | 14 ++++++++++++++ 6 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 codea/snafu_04.0 create mode 100644 codea/snafu_04.call diff --git a/codea/snafu_02.0 b/codea/snafu_02.0 index 7871f2e..5b79633 100644 --- a/codea/snafu_02.0 +++ b/codea/snafu_02.0 @@ -5,3 +5,7 @@ end; method r(x y) return (x - y) - 10; end; + +method s(x y) + return 6 - (x - 1); +end; diff --git a/codea/snafu_02.call b/codea/snafu_02.call index 4e9d749..a371164 100644 --- a/codea/snafu_02.call +++ b/codea/snafu_02.call @@ -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)); diff --git a/codea/snafu_03.0 b/codea/snafu_03.0 index 8dbf0d9..c43ec47 100644 --- a/codea/snafu_03.0 +++ b/codea/snafu_03.0 @@ -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; diff --git a/codea/snafu_03.call b/codea/snafu_03.call index b39ff85..6fa61c0 100644 --- a/codea/snafu_03.call +++ b/codea/snafu_03.call @@ -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 index 0000000..6cc265b --- /dev/null +++ b/codea/snafu_04.0 @@ -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 index 0000000..84cf59d --- /dev/null +++ b/codea/snafu_04.call @@ -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)); -- 2.25.1