ORG 0000HAJMP MAINORG 000BHAJMP INTT0ORG 0030HMAIN:MOV TMOD,#01HMOV TH0,#3CHMOV TL0,#0B0HMOV DPTR,#TABSETB EASETB ET0SETB TR0L2: MOV R7,#00HL1: MOV A,#0MOV B,#10DIV ABSETB P2.2SETB P2.1SETB P2.0MOVC A,@A+DPTRMOV P0,A CLR P2.3 SETB P2.3MOV A,BMOVC A,@A+DPTRMOV P0,A CLR P2.2 SETB P2.2MOV A,#10MOV B,#10DIV ABMOVC A,@A+DPTRMOV P0,A CLR P2.1 SETB P2.1MOV A,BMOVC A,@A+DPTRMOV P0,A CLR P2.0 SETB P2.0CJNE R7,#14H,L1LOOP1:MOV R6,#20HMOV R2,#00HMOV R4,#09HLOOP:MOV R3,#59HERE:MOV A,R3MOV B,#10DIV ABSETB P2.2SETB P2.1SETB P2.0 MOVC A,@A+DPTRMOV P0,A CLR P2.3 SETB P2.3MOV A,BMOVC A,@A+DPTRMOV P0,ACLR P2.2 SETB P2.2MOV A,R4MOV B,#10DIV ABMOVC A,@A+DPTRMOV P0,ACLR P2.1 SETB P2.1MOV A,BMOVC A,@A+DPTRMOV P0,ACLR P2.0SETB P2.0KAIGUAN:JB P2.6,L4CLR TR0L6: MOV A,R3MOV B,#10DIV ABSETB P2.2SETB P2.1SETB P2.0 MOVC A,@A+DPTRMOV P0,A CLR P2.3 SETB P2.3MOV A,BMOVC A,@A+DPTRMOV P0,ACLR P2.2 SETB P2.2MOV A,R4MOV B,#10DIV ABMOVC A,@A+DPTRMOV P0,ACLR P2.1 SETB P2.1MOV A,BMOVC A,@A+DPTRMOV P0,ACLR P2.0SETB P2.0 JB P2.7,L6SETB TR0AJMP L4L4:CJNE R2,#14H,HEREDJNZ R6,$ MOV R2,#00HDEC R3CJNE R3,#0FFH,HEREDEC R4CJNE R4,#0FFH,LOOPAJMP L2 INTT0:MOV TH0,#3CHMOV TL0,#0B0HINC R2INC R7RETITAB:DB 040H,079H,24H,030H,019H,12H,02H,78H,00H,10HEND
評(píng)論