Advertisement
MaxXLive

8051 Matrixtastatur

Dec 10th, 2017
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $nomod51 nosb
  2. $nolist
  3. $include(reg515.inc)
  4. $list
  5.  
  6. org 0000h
  7. MOV P4, #11111111b
  8. JMP start
  9.  
  10. start:
  11.     MOV P5, #11111111b
  12.     CLR P5.0
  13.     JNB P5.4, show1
  14.     JNB P5.5, show2
  15.     JNB P5.6, show3
  16.     SETB P5.0
  17.    
  18.     CLR P5.1
  19.     JNB P5.4, show4
  20.     JNB P5.5, show5
  21.     JNB P5.6, show6
  22.     SETB P5.1
  23.    
  24.     CLR P5.2
  25.     JNB P5.4, show7
  26.     JNB P5.5, show8
  27.     JNB P5.6, show9
  28.     SETB P5.2
  29.    
  30.     CLR P5.3
  31.     JNB P5.4, showclear
  32.     JNB P5.5, show0
  33.     JNB P5.6, showh
  34.     SETB P5.3
  35.    
  36.     JMP start
  37.  
  38.  
  39. show1:
  40.     MOV P4, #11111001b
  41.     JMP start
  42.  
  43. show2:
  44.     MOV P4, #10100100b
  45.     JMP start
  46.  
  47. show3:
  48.     MOV P4, #10110000b
  49.     JMP start
  50.  
  51. show4:
  52.     MOV P4, #10011001b
  53.     JMP start
  54.  
  55. show5:
  56.     MOV P4, #10010010b
  57.     JMP start
  58.  
  59. show6:
  60.     MOV P4, #10000010b
  61.     JMP start
  62.  
  63. show7:
  64.     MOV P4, #11111000b
  65.     JMP start
  66.  
  67. show8:
  68.     MOV P4, #10000000b
  69.     JMP start
  70.  
  71. show9:
  72.     MOV P4, #10010000b
  73.     JMP start
  74.  
  75. showclear: ; bei '*' ausgewählt wird die anzeige gecleart
  76.     MOV P4, #11111111b
  77.     JMP start
  78.  
  79. show0:
  80.     MOV P4, #11000000b
  81.     JMP start
  82.  
  83. showh: ; bei '#' wird ein H ausgegeben
  84.     MOV P4, #10001001b
  85.     JMP start
  86.  
  87. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement