AVR Assembler, Blink LED, 8-bit Timer/Counter2 with Pointers

AVR Assembler, Blink LED, 8-bit Timer/Counter2 with Pointers
Çeşme:
https://mil.ufl.edu/3744/examples/Table_Load_Example.asm
  1. Arduino UNO
.nolist .include "./m328Pdef.inc" .list .def temp = r16 .def overflows = r17 .def coin = r18 .def length = r19 .org 0x0000 rjmp start .org 0x100 table: .db 0x20, 0x00 .org 0x000E rjmp TIMER2_COMPA ; Timer/Counter2 Compare Match A .cseg start: clr length ser temp out DDRB, temp ldi temp, 0xff out DDRB, temp ldi temp, (1<<COM2A1)|(1<<WGM21) sts TCCR2A, temp ; 156.25 = (0.01 * 16000000)/1024 = 0x9C ldi temp, 0x9C sts OCR2A, temp ldi temp, (1<<OCIE2A) sts TIMSK2, temp ldi temp, (1<<CS22)|(1<<CS21)|(1<<CS20) sts TCCR2B, temp sei loop: nop rjmp loop TIMER2_COMPA: cpi length, 0 brne PC+3 ldi ZL, low(table << 1) ldi ZH, high(table << 1) cpi length, 2 brlt PC+2 clr length inc overflows cpi overflows, 50 brne PC+3 clr overflows inc length cpi overflows, 0 brne PC+3 lpm temp, Z+ out PORTB, temp reti