Eliminate enum: use const instead, with case-by-case parallel const implementations

This commit is contained in:
Rangi
2020-07-08 15:30:23 -04:00
parent 9e4a00af45
commit 6ca82e5c86
24 changed files with 543 additions and 560 deletions

24
macros/const.asm Normal file
View File

@@ -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