chiark / gitweb /
put something in testflash; some opcodes changed
authorian <ian>
Sun, 15 May 2005 21:35:49 +0000 (21:35 +0000)
committerian <ian>
Sun, 15 May 2005 21:35:49 +0000 (21:35 +0000)
cebpic/morsepanic.asm

index bfcafc7f6b849d48ef49316bb884f799502cf6dd..0b7378025248ea45c0fedc8245b530a34c86f171 100644 (file)
@@ -139,6 +139,8 @@ informative_panic
         bsf     T0CON,0,0       ; }
 
 panic_loop
+       mov_lw          0x5a
+       mov_wf          TESTFLASH
        call    led_black
        call    waiting
        call    waiting
@@ -172,15 +174,15 @@ morse_msg_start
        clrf    WREG3,0         ; clear loop counter (WREG3)
 
 morse_loop
-       movlw   MORSE_MSG_LENGTH
-       cpfslt  WREG3,0         ; if loop counter >=MORSE_MSG_LENGTH, 
-                               ; retun to panic
-       return
-       tblrd*+
-       movff   TABLAT,WREG2
-       call    morse_readout
-       incf    WREG3,1,0
-       goto    morse_loop
+       mov_lw          MORSE_MSG_LENGTH
+       cmp_fw_ifge     WREG3           ; if loop counter >=MORSE_MSG_LENGTH, 
+       return                          ; return to panic
+
+       tblrd           *+
+       mov_ff          TABLAT,WREG2
+       call            morse_readout
+       inc_f           WREG3
+       goto            morse_loop
 
 
 ;--------------------------
@@ -196,28 +198,28 @@ morse_readout
 ; WREG2                flash pattern           preserved
 ; WREG4                any                     undefined
 
-       clrf    WREG4,0         ; clear loop counter (WREG4)
-       rrncf   WREG2,1
+       clr_f           WREG4           ; clear loop counter (WREG4)
+       rr_f            WREG2
 
 morse_readout_loop
-       movlw   8
-       cpfslt  WREG4,0         ; if loop counter >=8, return
+       mov_lw          8
+       cmp_fw_ifge     WREG4           ; if loop counter >=8, return
        return
 
-       rlncf   WREG2,1         ; top bit goes into N flag, ie Negative if 1
-       bn      morse_readout_if_led_1
+       rl_f            WREG2           ; top bit goes into N, ie Negative if 1
+       bra_n           morse_readout_if_led_1
 
 morse_readout_if_led_0
-        call   led_black
-       bra     morse_readout_endif_led
+        call           led_black
+       bra             morse_readout_endif_led
 
 morse_readout_if_led_1
-       call    led_red
+       call            led_red
 
 morse_readout_endif_led
-       incf    WREG4,1,0       ; increment loop counter
-       call    waiting
-       bra     morse_readout_loop
+       inc_f           WREG4           ; increment loop counter
+       call            waiting
+       bra             morse_readout_loop
 
 ;--------------------------
 ;--------------------------