new version
authorTobias Girstmair <tobi@isticktoit.net>
Thu, 4 Mar 2021 00:39:48 +0000 (01:39 +0100)
committerTobias Girstmair <tobi@isticktoit.net>
Thu, 4 Mar 2021 00:40:17 +0000 (01:40 +0100)
bsv.c

diff --git a/bsv.c b/bsv.c
index 305044e61f2d7dae541ac0d82dc52aa7613b2aa5..672ecf5bbff1782c63b7b23c22dca7b9735e7b23 100644 (file)
--- a/bsv.c
+++ b/bsv.c
@@ -17,49 +17,81 @@ void g(u8 t){
 }
 void main(void){
        i0 = i1 = i2 = 0;
+       // clear i0
+       // clear i1
+       // clear i2
        for(;;) {
                u8 sample;
                u8 n = i2<<2 | i1>>6;
+               // mov n, i2
+               // sl n
+               // sl n
+               // mov acc, i1
+               // swap acc
+               // and acc, 0xf
+               // sr acc
+               // sr acc
+               // or n, acc
                u8 s = i2>>1;
+               // mov s, i2
+               // sr s
 
                g(n);
+               //^TODO
                acc >>= 4;
+               // swap acc
                acc &= 1;
+               // and acc, 0x1
                sample = acc;
+               // mov sample, acc
 
                { u8 tmp;
                  tmp = i2<<3 | i1>>5;
                  tmp ^= n;
                g(tmp);
+               //^TODO
+               } //tmp
                acc >>= 2;
+               // sr acc
+               // sr acc
                acc &= s;
+               // and acc, s
                acc &= 3;
+               // and acc, 3
                sample += acc;
-               } //tmp
+               // add sample, acc
 
-               { u8 tmp1 = s/3;
-                 u8 tmp2;
+               { u8 tmp2;
                  tmp2 = (i2<<5|i1>>3)%3;
                  tmp2 += n;
                g(tmp2);
+               //^TODO
+               } //tmp2
                acc >>= 2;
+               // sr acc
+               // sr acc
+               { u8 tmp1 = s/3;
                acc &= tmp1;
+               //^TODO
+               } //tmp1
                acc &= 3;
+               // and acc, 3
                sample += acc;
-               } //tmp1, tmp2
+               // add sample, acc
 
-               { u8 tmp1 = s/5;
-                 u8 tmp2 = n;
+               { u8 tmp2 = n;
                  { u8 tmp3 = (i2<<6|i1>>2)%3;
                    tmp2 -= tmp3;
                  } // tmp3
                  tmp2 += 8;
                g(tmp2);
+               } //tmp2
                acc >>= 1;
+               { u8 tmp1 = s/5;
                acc &= tmp1;
+               } //tmp1
                acc &= 3;
                sample += acc;
-               } //tmp1, tmp2
 
                putchar(sample<<4);
 
Imprint / Impressum