ghettodimasta

Untitled

Dec 8th, 2020
1,032
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .global main
  2. main:
  3.     in r25, 0x00
  4.     in r24, 0x03
  5.     add r25, r24
  6.     out 0x08, r25
  7.     jmp main
  8.  
  9. /*avr-gcc -01 -DPROC_atmega2560=1 -mmcu=atmega2560 sum.c*/
  10.  
  11.  
  12. /*ASM №2 datasheet*/
  13.  
  14. /*PINA -> 25*/
  15. in r25, 0x00
  16.  
  17. //out 0x08, rXX
  18. ldi r24, lo8(3)
  19. cpi r25, r24
  20. brsh L
  21. /*(1) x < 3*/
  22. mul r25, r25
  23. out 0x08, r25
  24. jmp Fin
  25.  
  26.  
  27. L:
  28.  
  29. ldi r24, lo8(20)
  30. cpi r24, r25
  31. brlo L1
  32.  
  33.  
  34. ldi r24, lo8(50)
  35. sub r24, r25
  36. out 0x08, r24
  37. jmp Fin
  38.  
  39.  
  40. L1:
  41.  
  42.  
  43.  
  44.  
  45. Fin:
  46.  
RAW Paste Data