diff options
Diffstat (limited to 'macros/const.asm')
-rw-r--r-- | macros/const.asm | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/macros/const.asm b/macros/const.asm new file mode 100644 index 00000000..e0d9fbb8 --- /dev/null +++ b/macros/const.asm @@ -0,0 +1,24 @@ +; Enumerate constants + +const_def: MACRO +IF _NARG >= 1 +const_value = \1 +ELSE +const_value = 0 +ENDC +IF _NARG >= 2 +const_inc = \2 +ELSE +const_inc = 1 +ENDC +ENDM + +const: MACRO +\1 EQU const_value +const_value = const_value + const_inc +ENDM + +shift_const: MACRO +\1 EQU (1 << const_value) +const_value = const_value + const_inc +ENDM |