Advertisement
Guest User

AVR Assembly

a guest
Sep 30th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     .def i=r16
  2.     .def variable=r17
  3.  
  4.     init:
  5.         ldi tmp, LOW(RAMEND)
  6.         out SPL, tmp
  7.         ldi tmp, HIGH(RAMEND)
  8.         out SPH, tmp
  9.  
  10.     loop:
  11.         cpi i, 255
  12.         brsh end_while
  13.         cpi variable, 1
  14.         brne end_if
  15.         rcall i
  16.         ldi variable, 0
  17.         rjmp end_if
  18.  
  19.     end_if:
  20.         mul i, 3
  21.         cpi i, 255
  22.         brsh end_if_2
  23.         rcall i
  24.         rjmp end_if_2
  25.  
  26.     end_if_2:
  27.         cpi i, 255
  28.         brsh end_while
  29.         dec i
  30.         rcall i
  31.         brsh end_while
  32.  
  33.     end_while:
  34.         ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement