RMB is 16-bit binary formatted
ep00ch opened this issue · 4 comments
RMB is 16-bit binary formatted, and I cannot override it with a dec range. Binary formatting for RMB seems very unusual, and decimal formatting seems to be pretty typical. I think this has to do with:
#define DATATYPE_RMB (DATATYPE_WORD | DATATYPE_BINARY | DATATYPE_HEX)
and the order of operations in the number_string()
function. Since the "IS_BINARY" check is first, it resolves as binary, and prints it that way.
#define DATATYPE_RMB 0x0400
fixes the issue and makes it decimal, but I'm not sure If that is the best way to handle it, and it is maybe contrary to the logic of the datatype bit ranges.
I would submit a pull request, but , again, I am not sure this is the best way to handle the issue.
For many years, the various attributes were packed into a byte; Rainer Buchty "broke the dam" by changing the type of label
to int
. RMB
was added long before that, so it used one of the "impossible" combinations of other attributes. Even back then, it was a suboptimal solution since it always wrote hex values. The binary output must have crept in recently. I'll look into it.
That should do it ...
NB: this uses the default data type now (hex, unless "-dec" has been passed in), but you can override that by doing it like
label 0000 RmbDec
rmb 0000-000f
+dec 0000-000f ; or just +dec 0000
for example.
works great. Thanks!