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
;****************************************************************************