mirror of
https://github.com/gbdev/rgbds.git
synced 2026-10-03 02:35:39 +00:00
Test division and modulo at link time as well as asm time
This commit is contained in:
1 parent
093024c534
commit
1d4c741975
1 file changed
+3
-5
@@ -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
|
||||
|
||||
Reference in new issue
Block a user