SHARE
TWEET

Untitled

a guest Oct 10th, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Запрограммировать работу 4-разрядной секции
  2. порта PC микроконтроллера AVR на режим
  3. двоично-десятичного счета (0, 1, 2, … 9, 0…).
  4. .include "m8515def.inc"
  5. .def temp = r16
  6. .def cnt = r17
  7. .org $000
  8. rjmp init
  9. init:
  10. ldi temp, low(RAMEND) ;установка указателя стека
  11. out SPL, temp
  12. ldi temp, high(RAMEND)
  13. out SPH, temp ; на последнюю ячейку
  14. ser temp
  15. out DDRC, temp
  16. out PORTC, temp
  17. reset:
  18. ldi cnt, 0xFF
  19. loop:
  20. out PORTC, cnt
  21. ;rcall delay
  22. dec cnt
  23. cpi cnt, 0xF5 ; сравнение регистра с числом
  24. breq reset ; перейти если равно
  25. rjmp loop
  26. delay:
  27. ldi r18, 1
  28. d1: ldi r19, 1
  29. d2: ldi r20, 1
  30. d3: dec r20
  31. brne d3
  32. dec r19
  33. brne d2
  34. dec r18
  35. brne d1
  36. ret
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top