An alternative to using high/lowbyte for a word is to shift bits within the word
Some code might be pseudo
Code:
word var word
byte var byte
DATA at EEPROM location 0 = $FF // low byte of the word you want to read
DATA at EEPROM location 1 = $FF // high byte of the word you want to read
// program run time
READ EEPROM, 0, byte
word = byte
word = word << 8
READ EEPROM, 1,byte
word = word + byte
// now the word is in memory - word = $FFFF
byte = word
WRITE EEPROM 0,byte
word = word >> 8
byte = word
WRITE EEPROM 1,byte
// the value in word was not preserved here,
// it would have been needed to be saved first
This is helpful if you want to use variables larger than PBP supports
for some operations.
It would be simple to do a binary addition on two 64 bit integers this way,
and is more familiar outside of BASIC.
Bookmarks