This message contains an entire topic ported from a separate forum. The original message and all replies are in this single message. We have seeded this new forum with selected information that we expect will be of value to you as you search for answers to your questions.
Posted: Fri Jul 8, 2005 10:12 am
Hello everyone.......
How to alter PPAGE register manually? without using call and rtc.
Can I load PPAGE register with a value? For example PPAGE = $30 so that I can use it for branch or jump.
Thanks in advance
Posted: Fri Jul 8, 2005 11:52 am
Yes, you can write to it directly.
But you should make 100% sure that you are not executing code which is located at the PPAGE window area from 0x8000 to 0xBFFF. If you change PPAGE from code executing there, the HC12 will execute code from this the new page immediately, so you do not have time to jmp to the new PC anymore.
Using CALL or RTC are the only ways to change the PPAGE and the PC both at once in the same instruction.
Posted: Fri Jul 8, 2005 4:36 pm
Yes, alter PPAGE manually. The same way you would alter any other memory location. I do that with GCC. If you must, just add the asm code:
movb #0x30,0x30
Where the second is the address of PPAGE register?
Posted: Fri Jul 8, 2005 5:08 pm
See response from 11:52 am above