Try using decimal 255 in your formula instead of $100. The hex number $100 is equal to decimal 0001 0000 000. This might be a problem with your byte variable.
Robert
Try using decimal 255 in your formula instead of $100. The hex number $100 is equal to decimal 0001 0000 000. This might be a problem with your byte variable.
Robert
"No one is completely worthless. They can always serve as a bad example."
Anonymous
100H = 256 though not 255 so won't that give the wrong checksum?
It's two's complement asfaik. Not that means a great deal to me anyway Doh!
Here is an example checksum with correct result. $04,$06,$04,$FF,$00,($F3 = CS)
Oh, I see what you mean. Anyways, I'm almost sure (I haven't tested it though) that combining your 9 bit number ($100) with your byte variable is what is causing the overflow problem. You might need to find a workaround.
Good luck.
"No one is completely worthless. They can always serve as a bad example."
Anonymous
Bookmarks