Given a common register, to detect the transition from 0 to 255 (DECF), what can I test? Is it any trick other than looking for the value 255 in the byte?
I wonder if the OP is trying to avoid decrementing a register if its value is 0? If that's the case, most of us recommend testing for that condition before performing the decrement operation. Isn't that right guys?
I wonder if the OP is trying to avoid decrementing a register if its value is 0? If that's the case, most of us recommend testing for that condition before performing the decrement operation. Isn't that right guys?
I wonder if the OP is trying to avoid decrementing a register if its value is 0? If that's the case, most of us recommend testing for that condition before performing the decrement operation. Isn't that right guys?
How about
decf file,F
incfsnz file,W ; check if file was zero before the decrement
goto WasZero
Or OV=1 and N=1 gives the same thing.
Checking Z=0 will give all numbers except zero.
Checking N=1 will give all numbers from 0x80 to 0xff.
Checking just OV will give 255 and 127.
Someone with more knowledge about 18 code, does the Carry flag act as a borrow and is therefore reset only if there is a transition from 0 to 255? This would seem likely to me.