From: ceb Date: Sun, 15 May 2005 21:50:30 +0000 (+0000) Subject: add extra gp between nybbles of register readout X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=9347d2eba26101218dbb6bdf72eb10d648bcc663;p=trains.git add extra gp between nybbles of register readout --- diff --git a/cebpic/morsepanic.asm b/cebpic/morsepanic.asm index 0b73780..e8eadeb 100644 --- a/cebpic/morsepanic.asm +++ b/cebpic/morsepanic.asm @@ -246,30 +246,37 @@ register_readout clrf WREG4,0 ; clear loop counter (WREG4) rrncf WREG2,1 + register_readout_loop - movlw 8 - cpfslt WREG4,0 ; if loop counter >=8 (register length), return + movlw 8 + cpfslt WREG4,0 ; if loop counter >=8 (register + ; length), return return - rlncf WREG2,1 ; top bit goes into N flag, ie Negative if 1 - bn register_readout_if_led_1 + movlw 4 + cmp_fw_ifne WREG4,0 ; if loop counter !=4 (nybble length), + ; skip insertion of extra black space + goto not_nybble_boundary + call waiting + +not_nybble_boundary + rlncf WREG2,1 ; top bit goes into N flag, + ; ie Negative if 1 + bn register_readout_if_led_1 register_readout_if_led_0 - call led_red - bra register_readout_endif_led + call led_red + bra register_readout_endif_led register_readout_if_led_1 - call led_green + call led_green register_readout_endif_led - incf WREG4,1,0 ; increment loop counter - call waiting - call led_black - call waiting - bra register_readout_loop - - - + incf WREG4,1,0 ; increment loop counter + call waiting + call led_black + call waiting + bra register_readout_loop ;****************************************************************************