.include "m328def.inc"
.org 0x0000
RJMP begin ; jump to begin
.org 0x0034
begin: CLI
1/>LDI R16,low(RAMEND)
1/>OUT SPL,R16
1/>LDI R16,high(RAMEND)
1/>OUT SPH, R16
1/>LDI R16,0xFF
1/>OUT DDRD, R16
mainloop: 1/>LDI R16,0xFF ; tuns the light on
1/>OUT PORTD, R16
RCALL Delay
1/>LDI R16,0x00 ; turns the light off
1/>OUT PORTD, R16
RCALL Delay ;Calls on the Loop
RJMP mainloop ;restarts the process
Delay: 1/>LDI R17, 0x6F ;States the first value
loop1: 1/>LDI R18, 0xDC
loop2: 1/>LDI R19, 0XDC
loop3: 1/>DEC R19
BRNE loop3
1/>DEC R18
BRNE loop2
1/>DEC R17 ; decreases fist value
BRNE loop1
1/>RET ; End of the loops