Twos-Comp Negative Numbers in Data Statements Compile to Incorrect Values
Zoot
Posts: 2,227
In the current SX/B release, the following compiles and programs, but the values compiled to .src are INCORRECT:
This does compile to correct value:
From SX/B doc...
WDATA/DATA
Creates a table of data values for use with the READ instruction.
• Label is the symbolic name for the table and serves as a pointer to the location of table index zero.
• Const is any constant (byte, ASCII character, or computed value).
...which would lead me to believe the first example should work.
Not a big deal, but this threw some havoc in into some "negative" servo offsets I was using in a data table.
Until I closely examined the .src output, I didn't catch that my code was fine, but the compiled data was not. Have not had a chance to check out in the beta SX/B yet.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
DATA -1 ' would think it would compile to $FF, but does not ' etc
This does compile to correct value:
foo CON -1 DATA foo
From SX/B doc...
WDATA/DATA
Creates a table of data values for use with the READ instruction.
• Label is the symbolic name for the table and serves as a pointer to the location of table index zero.
• Const is any constant (byte, ASCII character, or computed value).
...which would lead me to believe the first example should work.
Not a big deal, but this threw some havoc in into some "negative" servo offsets I was using in a data table.
Until I closely examined the .src output, I didn't catch that my code was fine, but the compiled data was not. Have not had a chance to check out in the beta SX/B yet.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
Comments
This is fixed in the beta version.
Thanks for pointing it out, I'll add it to the download thread.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.iElectronicDesigns.com
·