This is probably a bit of a daft question but anyway...
If you define a variable as a word and then keep adding 1 to it when it's at 255 and you add another 1 what happends?
I need to count to over 800, and was initially thinking a word variable keep adding 1 and testing with an if x = 800 then, but I suspect that won't work, I think the lower byte will over flow back to 1, and I have no idea what the if will do.
Tom
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK, looking at the generated ASM file, when the lower byte rolls over in a word variable it does handle it correctly, ie carries into the upper byte as well.
As for the if statement, haven't quite figured out what the ASM is doing there.
Tom
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Evening All
This is probably a bit of a daft question but anyway...
If you define a variable as a word and then keep adding 1 to it when it's at 255 and you add another 1 what happends?
I need to count to over 800, and was initially thinking a word variable keep adding 1 and testing with an if x = 800 then, but I suspect that won't work, I think the lower byte will over flow back to 1, and I have no idea what the if will do.
Tom
OK, looking at the generated ASM file, when the lower byte rolls over in a word variable it does handle it correctly, ie carries into the upper byte as well.
As for the if statement, haven't quite figured out what the ASM is doing there.
Tom