chiark / gitweb /
reset tblptr when we go round again; try new TG message; properly indirect printy...
authorian <ian>
Mon, 16 May 2005 00:23:43 +0000 (00:23 +0000)
committerian <ian>
Mon, 16 May 2005 00:23:43 +0000 (00:23 +0000)
cebpic/morsepanic.asm

index 02b2a782572328c4e5a00554eaa664e331847762..2557bed9257b201c1c621a94b5b9f6f6fc564e6c 100644 (file)
@@ -142,7 +142,10 @@ vector_reset
 ; INTERRUPT SUBROUTINES
 
 interrupt_low
-       panic   morse_TF
+       mov_lw          0x5a
+       mov_wf          TESTFLASH
+
+       panic   morse_TG
 
 panic_routine
 ; switch off interrupts and power
@@ -163,6 +166,7 @@ panic_routine
 ; 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           
@@ -183,8 +187,6 @@ panic_routine
        and_wff PANIC_REGS
        swap_f  PANIC_REGS      ; PANIC_REGS now contains # registers to read
 
-
-panic_loop
        call    led_black
        call    waiting
        call    waiting
@@ -271,9 +273,25 @@ register_loop
        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
 
 ;--------------------------