Sorry, I meant to get back to this sooner but I knew it would take awhile, which is part of my point in this thread.

Quote Originally Posted by pedja089 View Post
Just found R0 in my ISR... And it's from remainder...
It's more than that.

Along with the R0 you see in the immediate code generated by the modulus (//) statement, there's also a call to DIV in the library code.
DIV uses the R0, R1, R2 and R3 system variables.

So unless you take the time to follow every CALL (library routines call other functions too) you can't be sure of what variables you need to save.

Quote Originally Posted by pedja089 View Post
Just found my answer in ReEnterPBP-18 file... Thanks Darrel
I think that is too much things to save, and restore. So it would bi much better to do everything in ASM even if it requires to write basic functions like reminder in this case...
Well, just think of DT_INTS as a stepping stone.
Now that you understand what it takes to write interrupts that don't conflict with PBP ... Go for it!
Or use DT_INTS and get some sleep tonight.

Either way, keep in mind that DT_INTS runs ASM interrupts with very little overhead and greater control.
It's only when ReEnterPBP.bas is used with PBP interrupts that the system variables are saved.
ASM interrupts will always give the best performance.