What mac said is 100% correct.
Just to further explain, the hardware does NOT save register H on interrupt, I believe for 05 compatibility.
So, if you do anything in the interrupt, in the compiler will save register H on the stack (apparently even if it did not need to) and restore it.
In th future, you can use the 'disassemble' function on the right click menu to view the code that compiler generated. It's a great cheat for writing assembly language. Also, you may decide to stop using assembly language once you better understand how the compiler does things, as using asm makes it harder to switch processors.
The for the few instructions that require asm language, there are provided macros that port to all Flexis family products. In a few months when the CF V1 USB chips come out, you may decide to move.
Processor Expert is quite good at moving a project from 08 to CF, but it can't do much about asm code.
If you generate all your I/O with Processor Expert, it can move you from 08 to Flexis with like 5 clicks. There is a demo that comes with the DEMOQE board that does just that. However, except for the vector table most i/o code will port either way.
Code:
Didn't really need to save it, but it did.
60: volatile char data; 61: __interrupt void isrVirq(void) 62: { 0000 8b [2] PSHH // the hardware doe NOT save this. 63: 64: data = 1; 0001 a601 [2] LDA #1 0003 c70000 [4] STA data 65: asm { 66: 67: } 68: /* Clear interrupt flag */ 69: } 0006 8a [3] PULH 0007 80 [9] RTI 70: