From: ian Date: Mon, 16 May 2005 00:23:43 +0000 (+0000) Subject: reset tblptr when we go round again; try new TG message; properly indirect printy... X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=ff5c7f0f02c19c08741c81a00727f724e7ac81e9;p=trains.git reset tblptr when we go round again; try new TG message; properly indirect printy register thing; delay a couple of times after each reg to separate them --- diff --git a/cebpic/morsepanic.asm b/cebpic/morsepanic.asm index 02b2a78..2557bed 100644 --- a/cebpic/morsepanic.asm +++ b/cebpic/morsepanic.asm @@ -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 ;--------------------------