Test division and modulo at link time as well as asm time

This commit is contained in:
Rangi committed 2026-09-27 14:01:36 -04:00
1 parent 093024c534
commit 1d4c741975
1 file changed
+3 -5
+3 -5
View File
@@ -13,12 +13,10 @@ MACRO test_mod
def x = \1 ; dividend
def y = \2 ; divisor
shift 2
def q = x / y ; quotient
def r = x % y ; remainder
; identity laws
test (V (q * y + r)) == (V x)
test (V (x + y) % y) == (V r)
test (V (x - y) % y) == (V r)
test (V x) / y * y + (V x) % y == (V x)
test (V (x + y)) % y == (V x) % y
test (V (x - y)) % y == (V x) % y
ENDM
MACRO test_each_mod