Building a DATA table in SXB
RS_Jim
Posts: 1,771
Hi,
I am trying to build a data table with a series of 4 digit numbers. I would like to retrieve each entry·as a word with two digits in each byte.· However, when I enter the data in the form of:
WDATA 0175.0249,etc the compiler is giving me:
0075 0001 0049 0002 etc.· I have tried entering it as 75,01,49,02 etc and I have tried $0175,$0249 etc
Each time the compiler gives me back two words with leading 0.· What is the secret of building this table?
Jim
I am trying to build a data table with a series of 4 digit numbers. I would like to retrieve each entry·as a word with two digits in each byte.· However, when I enter the data in the form of:
WDATA 0175.0249,etc the compiler is giving me:
0075 0001 0049 0002 etc.· I have tried entering it as 75,01,49,02 etc and I have tried $0175,$0249 etc
Each time the compiler gives me back two words with leading 0.· What is the secret of building this table?
Jim
Comments
So if the "Word" data I wanted to write (say it was BCD numbers) is:
$1776
I would expect to see two 12 bit instructions in the compiler output:
DW $076 ' upper 4 bits of instruction = 0, lowest 8 bits are the low byte of my "Word" data
DW $017 ' upper 4 bits of instruction = 0, lowest 8 bits are the high byte of my "Word" data
In assembly and in SX/B 2.x there are strategies for using the whole 12 bits in cases where 12 bits is enough but 8 bits are too few. Or if you want to really "compact" Data by stuffing three 16 bit words into four data instructions (a savings of two instructions).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
If you post your code that would help alot.
It sounds to me like you want:
DATA 75,01,49,02 ' Note this is NOT WDATA
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
·The next time you need a hero don't look up in the sky...Look in the mirror.
·
Jim
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php