Using GBZ80 to do mod 24 using Chinese Remainder Theorem
a_mod_3: .loop sub 3 jr c, .loop add 3 ret dehl_mod_3: push bc ld b, 0 ld a, d call a_mod_3 ld b, a ld a, e call a_mod_3 add b ld b, a ld a, h call a_mod_3 add b ld b, a ld a, l call a_mod_3 add b pop bc cp 3 ret c call a_mod_3 ret dehl_mod_24: push bc ld a, l and 7 ld b, a srl srl srl add b ld b, a call dehl_mod_3 srl srl srl cpl add b pop bc ret
Comments
0 B
|👍
/👎
0 B
|👍
/👎