Closed Rangi42 closed 1 week ago
Thank you for your research, thorough as always :)
I don't feel convinced by this feature, because the primary use case, “far pointers”, are heterogeneous and I believe that (bank, ptr)
is roughly as common as (ptr, bank)
.
And also because I have thus far never witnessed a use of dl
, not even emulated by dw
s due to a lack of awareness.
The other use cases, I feel are niche enough to be emulated using db
s for RGB888 (db $12,$34,$56, $78,$9A,$BC
is fine..? And that's assuming you want the components stored in RGB order, too; dt
would give you BGR.) or warrant writing a macro.
Yeah, that's fair. Pokemon uses a few 3-byte values (e.g. for money and experience) but some of those would need a macro anyway for being big-endian or BCD, so plain dt
wouldn't get much use. (Probably more than dl
, but still not a lot.)
RGBDS has
db
/rb
for 8-bit bytes,dw
/rw
for 16-bit words, anddl
/rl
for 32-bit "long words". This leaves a gap for 24-bit values, which have various use cases both during assembly and runtime (bank+address, RGB888 color, any time you need "millions" of values but still with a fourth byte to spare).Prior terminology is uncommon, since historically 24-bit machines just called these "words" (the eZ80 even referred to "16-bit words" and "24-bit words" on the same platform!), and then we settled on powers of 2 for everything. Some examples do exist:
.DL
for for 24-bit "long words", and.DD
for 32-bit "double words". (But we can't usedl
/rl
because RGBDS's "long"s are different.)SWORD
is sometimes used to describe a 24-bit data type with theS
prefix referring to 'sesqui'." (But we can't useds
/rs
becauseds
is already a "define space" keyword. (Andrs
is not a keyword, but_RS
is a symbol.))TINYINT
,SMALLINT
,MEDIUMINT
,INT
, andBIGINT
for 1-, 2-, 3-, 4-, and 8-byte values respectively. (We could usedm
/rm
? Although I don't like how "rm
" looks like "remove".)dt
/rt
?)dt
macro for three-byte big-endian values. (pret could change that tobigdt
if RGBDS usesdt
/rt
-- frankly they should anyway, to make the endianness obvious and to match theirbigdw
macro.)Overall, I'd prefer adding
dt
/rt
keywords for "tribyte" data.