.nolist
.include"tn26def.inc"
.list
.def ar0 = r16
init:
ldi ar0, RAMEND
out SP, ar0
ldi ar0, 0xFF
out DDRA, ar0
ldi ar0, 0x00
out DDRB, ar0
ldi ar0, 0xAA
out PORTA, ar0
loop:
ldi zh, high(AMPEL*2)
ldi zl, low(AMPEL*2)
in ar0, PINB
cpi ar0, 0b00000000
breq ledout
ldi zh, high(PAUSE*2)
ldi zl, low(PAUSE*2)
cpi ar0, 0b00000001
breq ledout
ldi zh, high(ROLLON*2)
ldi zl, low(ROLLON*2)
brne ledout
ledout:
lpm
mov ar0, r0 ;get lentgh
_ldo1:
adiw ZH:ZL, 1
lpm ;get pattern
out PORTA, r0
rcall wait
dec ar0 ;count down
brne _ldo1
rjmp loop
wait:
ldi R17, $1F
WGLOOP0: ldi R18, $FD
WGLOOP1: ldi R19, $FE
WGLOOP2: dec R19
brne WGLOOP2
dec R18
brne WGLOOP1
dec R17
brne WGLOOP0
ldi R17, $04
WGLOOP3: dec R17
brne WGLOOP3
ret
AMPEL:
.db 77, 120
.db 120, 120
.db 120, 120
.db 120, 120
.db 120, 120
.db 120, 120
.db 120, 120
.db 120, 120
.db 120, 120
.db 120, 120
.db 120, 248
.db 120, 248
.db 120, 248
.db 120, 248
.db 120, 184
.db 184, 184
.db 184, 216
.db 216, 216
.db 216, 208
.db 208, 208
.db 208, 204
.db 204, 204
.db 204, 204
.db 204, 204
.db 204, 204
.db 204, 204
.db 204, 204
.db 204, 204
.db 204, 204
.db 204, 204
.db 220, 204
.db 220, 204
.db 220, 204
.db 220, 204
.db 212, 212
.db 212, 212
.db 216, 216
.db 216, 216
.db 152, 152
.db 152, 152
PAUSE:
.db 2, 180
.db 252, 0
ROLLON:
.db 4, 0b01101100
.db 0b10110100, 0b11011000
.db 0b11111100, 0
|