2020-07-08 12:30:23 -07:00
|
|
|
; Enumerate constants
|
|
|
|
|
2022-06-06 14:25:42 -07:00
|
|
|
MACRO const_def
|
|
|
|
if _NARG >= 1
|
|
|
|
DEF const_value = \1
|
|
|
|
else
|
|
|
|
DEF const_value = 0
|
|
|
|
endc
|
|
|
|
if _NARG >= 2
|
|
|
|
DEF const_inc = \2
|
|
|
|
else
|
|
|
|
DEF const_inc = 1
|
|
|
|
endc
|
2020-07-08 12:30:23 -07:00
|
|
|
ENDM
|
|
|
|
|
2022-06-06 14:25:42 -07:00
|
|
|
MACRO const
|
|
|
|
DEF \1 EQU const_value
|
|
|
|
DEF const_value += const_inc
|
2020-07-08 12:30:23 -07:00
|
|
|
ENDM
|
|
|
|
|
2022-06-06 14:25:42 -07:00
|
|
|
MACRO shift_const
|
|
|
|
DEF \1 EQU 1 << const_value
|
|
|
|
DEF const_value += const_inc
|
2020-07-08 12:30:23 -07:00
|
|
|
ENDM
|
2020-07-08 13:20:15 -07:00
|
|
|
|
2022-06-06 14:25:42 -07:00
|
|
|
MACRO const_skip
|
|
|
|
if _NARG >= 1
|
|
|
|
DEF const_value += const_inc * (\1)
|
|
|
|
else
|
|
|
|
DEF const_value += const_inc
|
|
|
|
endc
|
2020-07-08 13:20:15 -07:00
|
|
|
ENDM
|
|
|
|
|
2022-06-06 14:25:42 -07:00
|
|
|
MACRO const_next
|
|
|
|
if (const_value > 0 && \1 < const_value) || (const_value < 0 && \1 > const_value)
|
|
|
|
fail "const_next cannot go backwards from {const_value} to \1"
|
|
|
|
else
|
|
|
|
DEF const_value = \1
|
|
|
|
endc
|
2020-07-08 13:20:15 -07:00
|
|
|
ENDM
|
2021-03-04 15:13:33 -08:00
|
|
|
|
2022-06-06 14:25:42 -07:00
|
|
|
MACRO rb_skip
|
|
|
|
if _NARG == 1
|
|
|
|
rsset _RS + \1
|
|
|
|
else
|
|
|
|
rsset _RS + 1
|
|
|
|
endc
|
2021-03-04 15:13:33 -08:00
|
|
|
ENDM
|