PDA

View Full Version : High byte lost in HSEROUT a Word variable



Demon
- 7th October 2012, 06:50
Hi,

I probably can't see the forest because of the trees on this one, but I can't understand why the high byte of a Word variable is lost during HSEROUT:

Defined as:

CheckSum var word


This loses the high byte, only 1 byte is sent:

hserout [CheckSum]


This sends both bytes properly:

hserout [CheckSum.byte1, CheckSum.byte0]


Can someone clue me in why this is so? I couldn't find anything in the manual to explain this (PBP 2.60C).

Thanks!

Robert

Dave
- 7th October 2012, 14:21
Robert, The hserout command only sends bytes, 8 bits at a time. by saying "hserout [CheckSum.byte1, CheckSum.byte0]" you are telling the hserout command to send 2 bytes sequentially. You should look at the modifiers to be used with the hserout command, much like serout, lcdout and the such.

Demon
- 7th October 2012, 21:30
Ok, that makes sense.

Thanks!