Hi,
Haven't followed this from the beginning but I'll jump in here real quick.
A word is 16bits. A byte is 8bits. A word consists of 2bytes a high and a low. To combine 2 bytes into a word you can do:
Code:
MyWordResult var WORD
MyWordResult = Result_h * 256 + Result_l
HSEROUT [#MyWordResult,10]
If Result_h is 100 in decimal and Result_l is 25 in decimal. Your result would be 25625 in decimal. Or if you like in binary.
Code:
H I G H L O W
B Y T E B Y T E
MSB---> 01100100 00011001 <----LSB
See? The high byte is 100 and the low byte is 25.
Since the most significant bit in the low byte equals to 128 the least significant bit in the high byte equals to 256. That is why you multiply the highbyte by 256.
Or seeing it as 16bit word:
LSB MSB
1+0+0+8+16+0+0+0+0+0+1024+0+0+8192+16384+0 = 25625
/Henrik Olsson.
Bookmarks