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

diff --git a/bsv.c b/bsv.c
index 1ab399ee359ff5faa5f0b04a309365e7d5317015..42dfc41b9b0dca7b5dc1f13285146c9ecbe86923 100644 (file)
--- a/bsv.c
+++ b/bsv.c
@@ -64,8 +64,10 @@ void g(void){
        for (u8 loop = 0; loop < 8; loop++) {
                SR      (t)
                if (flag_c) {
-                       /*(2) ADDC a2, i1*/     a2 += i1 + ((a1+i0)>>8);
-                       /*(1) ADD  a1, i0*/     a1 += i0;
+                       MOV     (acc, i0)
+                       ADD     (a1, acc)
+                       MOV     (acc, i1)
+                       ADDC    (a2, acc)
                }
                SR      (a2)
                SRC     (a1)
index 89616238d25368e47133bbcb5534fee7f2a5ff84..8ff2ff7e7e62325f076ce4bd6be5d3772db85498 100644 (file)
--- a/fakeasm.h
+++ b/fakeasm.h
@@ -20,3 +20,4 @@ int flag_c = 0;
 #define SET1(dst, n)   dst |= 1<<n;
 #define IDXM(dst, ix)  dst = *(ix); //xxx: requires passing array+index
 #define SRC(dst)       dst >>= 1; dst |= flag_c<<7;
+#define ADDC(dst, src) dst += src+flag_c;
Imprint / Impressum