Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .include "m128def.inc"
- .org 0x00
- rjmp init
- .org 0x46
- .def i = r17
- .def tmp = r18
- .def sum = r19
- .def tmp2 = r20
- .def led = r21
- .macro showleds
- out PORTD, led
- swap led
- out PORTB, led
- swap led
- .endmacro
- init:
- ldi tmp, HIGH(0x160)
- out SPH, itmp
- ldi i, LOW(0x160)
- out SPL, tmp
- ldi tmp, 0xFF
- out DDRB, tmp
- out DDRD, tmp
- main:
- call szubrutin1
- loop1:
- rjmp loop1
- szubrutin1:
- ldi i, 11
- ldi tmp, 12
- ldi tmp2, 7
- clr sum
- loop:
- add sum, tmp
- add tmp, tmp2
- dec i
- brne loop
- st X, sum
- mov led, sum
- showleds
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement