#chip 18F4455, 48
Dim var1 as word
Dim var2 as word
var1 = 1
var2 = 256 - var1
The result is 511…why? This also happens on every byte boundary of var2, ie, 512, 1024, etc. Obviously an overflow, but why? Do constants larger than 255 have to be put into a properly Dim'd variable in order to do simple math?
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.