Advertisement
Guest User

temaDe8 Pic Assembler

a guest
Nov 11th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #include p16f877.inc
  2. Rx equ 0x21 ; B0
  3. Ry equ 0x22 ; B2
  4. Rz equ 0x20 ; B1
  5.  
  6. main: BCF STATUS,RP1
  7. BCF STATUS,RP0
  8. MOVLW D'15'
  9. MOVWF Rx
  10. BSF STATUS,RP1
  11. BCF STATUS,RP0
  12. MOVWF Ry
  13. RLF Ry,1
  14. BCF Ry,0
  15. BCF STATUS,RP1
  16. BCF STATUS,RP0
  17. MOVF Rx,0
  18. BSF STATUS,RP1
  19. BCF STATUS,RP0
  20. ;BCF STATUS,C
  21. ADDWF Ry,0
  22. BTFSS STATUS,C
  23. goto finalus
  24. CLRW
  25. BSF STATUS,RP1
  26. BCF STATUS,RP0
  27. MOVF Ry
  28. BCF STATUS,RP1
  29. BCF STATUS,RP0
  30. SUBWF Rx,0
  31. BCF STATUS,RP1
  32. BSF STATUS,RP0
  33. MOVWF Rz
  34. goto endf
  35. finalus:
  36. BCF STATUS,RP1
  37. BSF STATUS,RP0
  38. MOVWF Rz
  39. endf:
  40. nop
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement