gha890826

8051-7SEG_frome0to9

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