Lauflicht.asm
1 | .include "m16def.inc"
| 2 |
| 3 | .def Temp =r16
| 4 | .def Delay =r17
| 5 | .def Delay2 =r19
| 6 | .def Delay3 =r18
| 7 | .def Delay4 =r20
| 8 |
| 9 | RESET:
| 10 |
| 11 | ser Temp
| 12 | out DDRB,Temp
| 13 |
| 14 |
| 15 | START:
| 16 |
| 17 | sbis PIND,0x00
| 18 | jmp LEDL
| 19 |
| 20 | sbis PIND,0x02
| 21 | jmp LEDR
| 22 |
| 23 | rjmp START
| 24 |
| 25 |
| 26 | LEDL:
| 27 |
| 28 | out PORTB,Temp
| 29 | rol Temp
| 30 |
| 31 | sbis PIND,0x01
| 32 | jmp START
| 33 |
| 34 | sbis PIND,0x02
| 35 | jmp LEDR
| 36 |
| 37 | DLY1:
| 38 |
| 39 | dec Delay
| 40 | brne DLY1
| 41 | dec Delay2
| 42 | brne DLY1
| 43 |
| 44 | rjmp LEDL
| 45 |
| 46 |
| 47 | LEDR:
| 48 |
| 49 | out PORTB,Temp
| 50 | ror Temp
| 51 |
| 52 | sbis PIND,0x01
| 53 | jmp START
| 54 |
| 55 | sbis PIND,0x00
| 56 | jmp LEDL
| 57 |
| 58 | DLY2:
| 59 |
| 60 | dec Delay3
| 61 | brne DLY2
| 62 | dec Delay4
| 63 | brne DLY2
| 64 |
| 65 | rjmp LEDR
|
|