Use const_skip and const_next macros for brevity

This commit is contained in:
Rangi
2020-07-08 16:20:15 -04:00
parent 6ca82e5c86
commit c086de0c98
27 changed files with 198 additions and 820 deletions

View File

@@ -22,3 +22,19 @@ shift_const: MACRO
\1 EQU (1 << const_value)
const_value = const_value + const_inc
ENDM
const_skip: MACRO
if _NARG >= 1
const_value = const_value + const_inc * (\1)
else
const_value = const_value + const_inc
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