Presumably you would write a naked ISR if you wanted to make the ISR faster. The problem comes in when you mix a naked ISRs with ZBasic code and knowing which registers to push. For example:
Code: Select all
ISR Timer1_CompB() Attribute(Naked)
#asm
; push registers here
#endasm
Call PutPin(D.7, 0) ' which registers are touched by this call
#asm
; pop registers here
reti ; always needed
#endasm
End ISR
Perhaps it should be a compiler warning/error to use ZBasic functions inside a native ISR - it is too dangerous.