I'm on the run today, so ultra-fast replies...
* Program starts for the evening for the first time ever:
Read 0,B0
(B0 now contains %00000000 as it has not had anything wrote to it yet)
W0=W0+23
(W0 now contains %0000000000010111 as W0 is a 16 bit WORD and 23 was added to, basically, zero)
...and B0 has 00010111 inside it!
Write 0,B0
(B0 now contains %00010111 as B0 just saves the first 8 bits of the 16 bit WORD to eeprom)
We're assuming all along that B0 is the LOWER 8 bits (bits 0 thru 7). If it happens to be the UPPER (bits 8 thru 15), then rather than playing with B0, we simply play with B1 instead. You can find out which is which through simple experimentation.
Loop:
RANDOM W0
So, first time around, 23 gets saved to EEPROM, next time its 46, next time it's...
So, what am I missing here with the bits and writing out what is happening at a BIT level?
I think you figured it!
You're smack-on with the bitwise compare examples. I don't see you're confusion, all your examples are 100% correct.
Bookmarks