new version
authorTobias Girstmair <tobi@isticktoit.net>
Thu, 4 Mar 2021 01:31:04 +0000 (02:31 +0100)
committerTobias Girstmair <tobi@isticktoit.net>
Thu, 4 Mar 2021 01:31:04 +0000 (02:31 +0100)
bsv.c
fakeasm.h

diff --git a/bsv.c b/bsv.c
index f9a41a7a5bdb8a14c2ae5380945841965cd5bcef..f892dfc2b73eca71efcec1d3e0b46546e2117be1 100644 (file)
--- a/bsv.c
+++ b/bsv.c
@@ -5,6 +5,7 @@ typedef unsigned char u8;
 u8 i0, i1, i2; //MEM
 u8 n; //MEM
 u8 sample; //MEM
+u8 tmp_1; //MEM
 u8 acc; //ACC
 
 u8 notes[] = {
@@ -41,11 +42,18 @@ void main(void){
                AND     (acc, 0x1)
                MOV     (sample, acc)
 
-               { u8 tmp = i2<<3 | i1>>5;//TODO
-               MOV     (acc, tmp)
+               MOV     (acc, i2)
+               SL      (acc)
+               SL      (acc)
+               SL      (acc)
+               XCH     (tmp_1)
+               MOV     (acc, i1)
+               SWAP    (acc)
+               AND     (acc, 0xf)
+               SR      (acc)
+               OR      (acc, tmp_1) // tmp_1 done.
                XOR     (acc, n)
                CALL    (g)
-               } //tmp
                SR      (acc)
                AND     (acc, i2)
                SR      (acc)
index 3b1c4045e3508c23ae6c81e61cb0210d4de6782c..7ee2afd8c5466c73a65c7bc593f451eaab2ac759 100644 (file)
--- a/fakeasm.h
+++ b/fakeasm.h
@@ -14,3 +14,4 @@ int flag_c = 0;
 #define CALL(addr)     addr();
 #define XOR(dst, src)  dst ^= src; flag_z = (dst==0);
 #define SUB(dst, src)  flag_c = (src > dst); dst -= src; flag_z = (dst==0);
+#define XCH(dst)       acc ^= dst; dst ^= acc; acc ^= dst;
Imprint / Impressum