Debugging an interrupt routine written in assembler

I’m new to this forum, so please be gentle. My problem is I am trying to debug an ISR written in assembly language.

I start the routine with the directive #asm debug. My first problem was that several “jump relative instructions” (jr) had to be changed to “jump” (jp) because the jr’s are out of range due to all the additional code that debug includes upon compile. Is changing all the jr’s to jp’s OK to get this to work?

The other issue is that I’ll set a breakpoint within the ISR, run the program and when the interrupt is triggered (from a timer B match register), the program appears to go off into never land and I eventually lose communications with the board.

Here is the first few lines:

#asm nodebug
_motor_pwm_isrB::
push af ; save registers
push hl
push de

.clear_B1_interrupt:
ioi ld a, (TBCSR) ; load B1, B2 interrupt flags

.get_time:
ioi ld a, (TBCLR) ; get current time (lowest 8 bits)

I would like to set the breakpoint at the first instruction after the label “.get_time:”. I need to single step through this ISR to get my app to work properly.

Thanks everyone.