2020-07-08 19:30:23 +00:00
|
|
|
; 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
|
2021-11-24 01:18:08 +00:00
|
|
|
const_value += const_inc
|
2020-07-08 19:30:23 +00:00
|
|
|
ENDM
|
|
|
|
|
|
|
|
shift_const: MACRO
|
2021-11-24 01:18:08 +00:00
|
|
|
\1 EQU 1 << const_value
|
|
|
|
const_value += const_inc
|
2020-07-08 19:30:23 +00:00
|
|
|
ENDM
|
2020-07-08 20:20:15 +00:00
|
|
|
|
|
|
|
const_skip: MACRO
|
|
|
|
if _NARG >= 1
|
2021-11-24 01:18:08 +00:00
|
|
|
const_value += const_inc * (\1)
|
2020-07-08 20:20:15 +00:00
|
|
|
else
|
2021-11-24 01:18:08 +00:00
|
|
|
const_value += const_inc
|
2020-07-08 20:20:15 +00:00
|
|
|
endc
|
|
|
|
ENDM
|
|
|
|
|
|
|
|
const_next: MACRO
|
|
|
|
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
|
|
|
|
const_value = \1
|
|
|
|
endc
|
|
|
|
ENDM
|
2021-03-04 23:13:33 +00:00
|
|
|
|
|
|
|
rb_skip: MACRO
|
|
|
|
if _NARG == 1
|
|
|
|
rsset _RS + \1
|
|
|
|
else
|
|
|
|
rsset _RS + 1
|
|
|
|
endc
|
|
|
|
ENDM
|