Open
Description
The hardware.inc convention is for <REG>B_<FIELD>
to be a 0-7 bit value, and <REG>F_<FIELD>
to be the corresponding mask value. A few examples:
DEF LCDCF_OBJ16 EQU %00000100 ; OBJ Construction
DEF LCDCB_OBJ16 EQU 2 ; OBJ Construction
DEF PADF_START EQU $08
DEF PADB_START EQU $3
DEF OAMF_PRI EQU %10000000 ; Priority
DEF OAMB_PRI EQU 7 ; Priority
I'd like to make these consistent in one of three ways:
- Always use binary, e.g.
%00000100
. - Always use hex, e.g.
$08
. - Define the F values in terms of the B values, e.g.
DEF OAMF_PRI EQU 1 << OAMB_PRI
.
The advantage of option 3 would be avoiding redundancy or mismatch between the values, making the connection obvious.
The advantages of 1 or 2 would be explicitly showing the numeric mask value (although that could still be a comment next to the 1 << B
, in either bin or hex).
My own preference is for option 3, but I wanted to get feedback from the maintainers here before PRing anything.
(If that is the preference, I'd even consider going further and having a macro like DEF_FLAG OAMB_PRI EQU 7, OAMF_PRI
to reduce the line count.)
Metadata
Assignees
Labels
No labels
Activity