gha890826

8051-7SEG_frome9to0

Apr 30th, 2020 (edited)
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. ORG 0H
  2. INTIAL:
  3. MOV DPTR,#TABLE
  4.  
  5. NUMLOOP:
  6. MOV R2,#10
  7. LOOP:
  8. MOV A,R2
  9. DEC A
  10. MOVC A,@A+DPTR
  11. MOV P0,A
  12. CALL DELAY_1S
  13. MOV P0,#00000000B
  14. CALL DELAY_1S
  15. DJNZ R2,LOOP
  16. JMP NUMLOOP
  17.  
  18.  
  19.  
  20. ;DELAY_1S
  21. DELAY_1S:
  22. MOV R7,#10
  23. DELAY_1Sa3:
  24. MOV R6,#200
  25. DELAY_1Sa2:
  26. MOV R5,#248
  27. NOP
  28. DELAY_1Sa1:
  29. DJNZ R5,DELAY_1Sa1
  30. DJNZ R6,DELAY_1Sa2
  31. DJNZ R7,DELAY_1Sa3
  32. RET
  33.  
  34. TABLE:
  35. DB 11111100B;0
  36. DB 01100000B;1
  37. DB 11011010B;2
  38. DB 11110010B;3
  39. DB 01100110B;4
  40. DB 10110110B;5
  41. DB 00111110B;6
  42. DB 11100000B;7
  43. DB 11111110B;8
  44. DB 11100110B;9
  45. DB 10011100B;C
  46. TABLEID:
  47. DB 0
  48. DB 0
  49. DB 7
  50. DB 6
  51. DB 10
  52. DB 0
  53. DB 3
  54. DB 3
  55.  
  56. END
Add Comment
Please, Sign In to add comment