summaryrefslogtreecommitdiff
path: root/macros/data.asm
diff options
context:
space:
mode:
Diffstat (limited to 'macros/data.asm')
-rw-r--r--macros/data.asm4
1 files changed, 4 insertions, 0 deletions
diff --git a/macros/data.asm b/macros/data.asm
index b6cedbf7..a2b1f23c 100644
--- a/macros/data.asm
+++ b/macros/data.asm
@@ -25,6 +25,10 @@ percent EQUS "* $ff / 100"
; e.g. 1 out_of 2 == 50 percent + 1 == $80
out_of EQUS "* $100 /"
+assert_power_of_2: MACRO
+ assert (\1) & ((\1) - 1) == 0, "\1 must be a power of 2"
+ENDM
+
; Constant data (db, dw, dl) macros
dwb: MACRO