SHARE
TWEET

Untitled

a guest Nov 18th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. START EQU P3.1
  2. RESET EQU P3.0
  3. BUZZ EQU P3.7
  4.  
  5. DISA EQU P3.3
  6. DISB EQU P3.2
  7. DISC EQU P3.6
  8.  
  9. ORG 0000H
  10. LJMP MAIN
  11. ORG 0040H
  12. MAIN:
  13.      CLR BUZZ
  14.      JB START,$                     ;WAIT FOR START BUTTON TO BE PRESSED
  15.      SETB DISA
  16.      SETB DISB
  17.      SETB DISC
  18. DD1:SETB DISA
  19.     MOV A,#09H                      ;SETTING FOR MINUTE
  20.     MOV R1,A
  21.     MOV R4,A
  22. DS1:MOV P0,R1
  23.     DD2:MOV A,#05H
  24.     DS2:MOV P2,A
  25.         DD3:MOV A,#09H
  26.         DS3:MOV P1,A
  27.             ACALL AAA
  28.             DEC A
  29.             CJNE A,#00H,DS3
  30.         MOV A,P2
  31.         MOV P1,#00H
  32.         ACALL AAA
  33.         DEC A
  34.         CJNE A,#00H,DS2
  35. TEN:MOV P2,#00H
  36.     MOV R6,#09H
  37.     TE:MOV P1,R6
  38.     DEC R6
  39.     ACALL AAA
  40.     CJNE R6,#00H,TE
  41.     MOV P1,#00H
  42. DEC R1
  43. ACALL AAA
  44. MOV P0,R1
  45. CJNE R1,#00H,DS1
  46. MOV P0,#00H
  47. LASTMIN:
  48. DE2:MOV A,#05H
  49.     DF2:MOV P2,A
  50.         DE3:MOV A,#09H
  51.         DF3:MOV P1,A
  52.             ACALL AAA
  53.             DEC A
  54.             CJNE A,#00H,DF3
  55.         MOV A,P2
  56.         MOV P1,#00H
  57.         ACALL AAA
  58.         DEC A
  59.         CJNE A,#00H,DF2
  60. LASTEN:
  61. MOV P0,#00H
  62. MOV P2,#00H
  63. MOV R6,#09H
  64.     TE1:MOV P1,R6
  65.     DEC R6
  66.     ACALL AAA
  67.     CJNE R6,#00H,TE1
  68.     MOV P1,#00H
  69.     SETB BUZZ
  70. JB RESET,$                       ;END OF COUNTDOWN.WAIT FOR RESET TO BE PRESSED
  71. MOV P0,R4
  72. MOV P2,#05H
  73. MOV P1,#09H
  74. CLR BUZZ
  75. JMP MAIN
  76. AAA:
  77. ACALL RST
  78. ACALL STP
  79. ACALL DELAY
  80. ACALL RST
  81. ACALL STP
  82. RET
  83. RST:                            ;RESETS ALL DISPLAYS AND RETURNS TO START  
  84. JB RESET,DOWN
  85. MOV P0,R4
  86. MOV P1,#09H
  87. MOV P2,#05H
  88. JMP MAIN
  89. DOWN:RET
  90. STP:                             ;PAUSE ROUTINE FOR TIMER
  91. S1:JB START,DWN
  92. SJMP S1
  93. DWN:RET
  94. DELAY:                           ;DELAY OF ONE SECOND
  95.         MOV TMOD,#01H
  96.         MOV TH0,#3CH
  97.         MOV TL0,#0B0H
  98.         MOV R7,#00H
  99.         SETB TR0
  100.     DEL:JNB TF0,DEL
  101.         MOV TH0,#3CH
  102.         MOV TL0,#0B0H
  103.         CLR TF0
  104.         INC R7 
  105.         CJNE R7,#14H,DEL
  106.         RET
  107.  
  108. END
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
 
Top