new version
authorTobias Girstmair <tobi@isticktoit.net>
Thu, 4 Mar 2021 12:24:45 +0000 (13:24 +0100)
committerTobias Girstmair <tobi@isticktoit.net>
Thu, 4 Mar 2021 12:24:45 +0000 (13:24 +0100)
bsv.c

diff --git a/bsv.c b/bsv.c
index 474e102a8912dac472875f9b757494b4bba34893..a0a1caa782a566565f644d88cfdbb7c6dba8496b 100644 (file)
--- a/bsv.c
+++ b/bsv.c
@@ -70,7 +70,29 @@ void main(void){
                MOV     (tmp_1, acc) // acc saved in tmp_1; fresh acc
                MOV     (acc, i2)
                // shift-divide by six
-               acc = i2/6;//TODO
+               // note: i2 is max 0x78; so acc will <= 20.
+
+                acc >>= 1;
+                acc += i2;
+
+                acc >>= 1;
+                acc += 0;
+
+                acc >>= 1;
+                acc += i2;
+
+                acc >>= 1;
+                acc += 0;
+
+                acc >>= 1;
+                acc += i2;
+
+                acc >>= 1;
+                acc += 0;
+
+                acc >>= 1;
+                acc >>= 1;
+
                // end divide by six
                AND     (acc, tmp_1) // acc restored from tmp_1
                AND     (acc, 3)
@@ -85,6 +107,7 @@ void main(void){
                SR      (acc)
                MOV     (tmp_1, acc) // acc saved in tmp_1; fresh acc
                // shift-divide by ten
+               // note: i2 is max 0x78; so acc will <= 12.
                acc = i2/10;//TODO
                // end divide by ten
                AND     (acc, tmp_1) // acc restored from tmp_1
Imprint / Impressum