new version
[Chiptunes.git] / foo.c
diff --git a/foo.c b/foo.c
index 7c030a4a2cf2b4eb7645f75f27643342f5dbea97..c8eacfffa85f8c2a74a08e5298305192b0542924 100644 (file)
--- a/foo.c
+++ b/foo.c
@@ -88,7 +88,8 @@ int main(void) {
                #define tmp o
                x = (x*0x55)>>8;
                #undef tmp
-               t = n + (((i3&0x01)<<13 | i2<<5 | i1>>3) % 3);
+               t = ((i3&0x01)<<13 | i2<<5 | i1>>3) % 3;
+               ADD     (t, n)
                LDI     (o, 10)
                RCALL   g();
                ADD     (acc, t)
@@ -99,7 +100,10 @@ int main(void) {
                #define tmp o
                x = (x*0x33)>>8;
                #undef tmp
-               t = 8 + n - (((i3&0x01)<<14 | i2<<6 | i1>>2) % 3);
+               t = ((i3&0x01)<<14 | i2<<6 | i1>>2) % 3;
+               SUB     (t, n)
+               NEG     (t)
+               SUBI    (t, -8)
                LDI     (o, 9)
                RCALL   g();
                ADD     (acc, t)
Imprint / Impressum