Deliberate mistake ;-).
Var[0] can only hold up to 255 so as it stands it may not be quite correct to adopt that technique.
What is the largest number you are using in each byte ? Does the lower byte count right up to 255 and then roll over, at the same time incrementing the higher byte ? Or, do you restrict the range of the lower byte to some other amount, such as 99 ?
If you can't jump directly to extracting the values you need using the 'dig' directive, then you can always write a short math routing to count off the two bytes.
sum var word
lower var byte
upper var byte
sum = (upper * 255) + lower
lcdout dec sum dig 4, dec sum dig 3, dec sum dig 2, dec sum dig 1 , dec sum dig 0
Bookmarks