Chapter sc_calc: andi r18, $07 ; mask off high bit of column# ; Shift left (R1) times to get the desired column latch byte ldi r17, $01 sc_c_lp: cpi r18, breq sc_c_done lsl r17 dec r18 rjmp sc_c_lp sc_c_done: out PORTA, r17 ; put latch byte on PORTA nop nop out PORTB, r20 nop nop andi r20, $C0 out PORTB, r20 ; Increment column column_done: lds r18, currentline inc r18 andi r18, $0F sts currentline, r18 ; Have we wrapped around to column 0? cpi r18, $00 brne rfsh_cont ; Yes! Reset pointer and update blink count ldi r26, low(framedata) ldi r27, high(framedata) lds r18, framecounter inc r18 ; See if we’ve had a blink overflow cpi r18, BLINK_RATE brne blink_ok lds ldi eor sts r18, flags r19, (1