View Full Version : Lowbyte

05-18-2006, 12:31 AM
hi all,
Can I separate a Word to LOWBYTE and HIGHBYTE on BS1? (this is for RF transmission of the Word)

Chris Savage
05-18-2006, 12:59 AM
If you know what register it's in (the variable) you can always pull the byte sized variables from those registers.· For example, if the data is in W0 then you could access B0 and B1.

Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)

Jon Williams
05-18-2006, 01:31 AM
You can, and here's an extention of what Chris notes above; all Word variables a busted into corresponding bytes:

W0··· B0· -- bit level access on W0 only
W1··· B2
W3··· B6
W4··· B8
W5··· B10
W6··· B12· -- CAUTION: Used as RETURN stack for GOSUB

Note that only W0 (B0/B1) has bit-level access, and there is no LOWBYTE·modifier as with the BS2; use the table above to create the proper variable aliases with SYMBOL, like this:

SYMBOL lights··· =·W0
SYMBOL lightsLo ·= B0
SYMBOL lightsHi· = B1

Jon Williams
Applications Engineer, Parallax