Bill,
I don't have time to give you a complete answer right now, but I believe you are making this too hard.
If you use DT-Ints, you don't need to worry about saving/restoring the registers, or any ORGs. All of that is taken care of for you.
All I can do right now is give you a snippet of some code that I have handy.
This code has only high priority INTs, but low-priority INTS are done the same way.
Go to Darrel's page and read about using his structure. It will really help you a lot.
You will notice that the code snippet below has both PBP and ASM ints.
MasterClock is defined as a BankA SYSTEM var so that PBP can access it.
All the vars (including the ASM vars) are declared in PBP.
Code:
'---------------------------------- End of basic assignment section ---------------------------------
INCLUDE "DT_INTS-18.bas" ; Base Interrupt System
INCLUDE "ReEnterPBP-18.bas" ; Include if using PBP interrupts
ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler TMR0_INT, SystemTimer, ASM, yes
INT_Handler RX1_INT, _GetCharPort1, PBP, yes
INT_Handler RX2_INT, _GetCharPort2, PBP, yes
INT_Handler INT2_INT, _GetXData, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM
Goto OverInt
'---[INT - interrupt handlers]-----------------------------------------------
ASM
SystemTimer
movff 0x0B,TMR0H ; 10 msec with /16 prescaler
movff 0xDC,TMR0L
infsnz MasterClock
incf MasterClock + 1
INT_RETURN
ENDASM
If no one else posts a better response, I'll send you more information tomorrow.
Bookmarks