INFO - FAQ - CC2-Forum - CCPro-Forum |
|
> ItÂ’s a thinking error of my own. > I read a long time ago that to break up a word into its 2 bytes you could do the following: > > Hibyte = word / 256 > Lobyte = word mod 256 Well, I guess your programm proved that what you read is not (always) true. > -1 is nothing but decimal 65535 Many 4th grade pupils probably would beg to differ. ;-) Both numbers might be represented by the same bit pattern (under certain circumstances), but that bit pattern can't be interpreted as both numbers at the same time. And since an arithmetical division ought to consider the sign, it is quite important, as which number the bit pattern is interpreted. BTW: You're just lucky that the shr-Operation you used is operating on a logical bit base and not on an arithmetical one as in CC 1.1 (which would keep the high bit as it is instead of inserting 0s). Bye Achim |
Antwort schreiben |