I recently (ok, today) discovered that the PBP TOGGLE command can toggle a variable, as well as output pins (which I used regularly).
I just tried a bit var, yep works. Goes 0-1-0-1.
Code:
Mode var bit
Mode_Butn var PortB.1
If mode_Butn = 0 then
Toggle Mode
LCDout $FE,$C8,"Mode",DEC1 mode
Pause 500
Endif
OK, the PBP manuals description is:
TOGGLE Pin
Invert the state of the specified Pin. Pin is automatically made an output. Pin may be a constant, 0 - 15, or a variable that contains a number 0 - 15 (e.g. B0) or a pin name (e.g. PORTA.0).
So what does the 'variable that contains a number 0-15 (e.g. B0)' mean ?
Does that mean that you can toggle any bit in a word, or just a number up to #15, or 0-15 variables ?
Bookmarks