; INTERRUPT SUBROUTINES
interrupt_low
- panic morse_TF
+ mov_lw 0x5a
+ mov_wf TESTFLASH
+
+ panic morse_TG
panic_routine
; switch off interrupts and power
; get # bytes of morse msg, # registers in panic readout, message start addr.
; back from condensed message start addr. stored in PANIC_ADDRESS
+panic_loop
movlw 4
mulwf PANIC_ADDRESS
movff PRODL,TBLPTRL
and_wff PANIC_REGS
swap_f PANIC_REGS ; PANIC_REGS now contains # registers to read
-
-panic_loop
call led_black
call waiting
call waiting
return ; return to panic
tblrd *+
- mov_ff TABLAT,WREG2
+
+ mov_fw TABLAT ; TABLAT has the 8-bit version
+ mov_wf FSR0L ; of the address. So, 8 bits
+ ; go straight into FSR0L.
+
+ mov_lw 0x0f ; For FSR0H, we see if the
+ mov_fw FSR0H ; address XX is >=0x60.
+ ; If it is then we meant 0xfXX;
+ mov_lw 0x5f ; if not then we meant 0x0XX.
+ cmp_fw_ifle FSR0L ; (This is just like PIC does
+ clr_f FSR0H ; for insns using Access Bank)
+
+ mov_ff INDF0,WREG2
call register_readout
+
inc_f WREG3
+
+ call waiting
+ call waiting
goto register_loop
;--------------------------