From b29570afdc3f0e8eab750512830537eb69377cd3 Mon Sep 17 00:00:00 2001 From: Tobias Girstmair Date: Thu, 4 Mar 2021 13:24:45 +0100 Subject: [PATCH] new version --- bsv.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/bsv.c b/bsv.c index 474e102..a0a1caa 100644 --- 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 -- 2.39.3