When PPAGE is 7 (last possible ppage) for 9S08QE128, doing INC PPAGE will make PPAGE zero but the Z flag will not be set.
This seemingly wrong result is actually correct in that the MCU internally is incrementing the 7 and getting a non-zero value. But, when the value is written back to PPAGE only bits 2..0 are affected (doing an implicit AND #7 operation) and the debugger will show you that PPAGE is zero right after the INC instruction executes, but the Z flag will be clear. So, this:
works, but the the nicer
Message Edited by tonyp on 2008-08-27 12:12 AM