本帖最后由 和哈哈哈和 于 2012-12-9 20:54 编辑
DISPBUF EQU 5AH
SecCoun EQU 59H
SpCoun EQU 57H ?
Count EQU 56H
SpCalc bit 00h
Hidden EQU 16
ORG 0000H
AJMP START
ORG 1BH
JMP
tiMER1
ORG 30H
START: MOV SP,#5FH
MOV P1,#0FFH
MOV P0,#0FFH
MOV P2,#0FFH
MOV TMOD,#00010101B
MOV TH1,#HIGH(65536-5000)
MOV TL1,#LOW(65536-5000)
SETB TR1
SETB ET1
SETB EA
LOOP:JNB SpCalc ,LOOP
MOV R2,SpCoun
MOV R3,SpCoun+1
MOV R6,#0
MOV R7,#60
call MULD
MULD: MOV A,R3
MOV B,R7
MUL AB
MOV R4,B
MOV R5,A
MOV A,R3
MOV B,R6
MUL AB
ADD A,R4
MOV R4,A
CLR A
ADDC A,B
MOV R3,A
MOV A,R2
MOV B,R7
MUL AB
ADD A,R4
MOV R4,A
MOV A,R3
ADDC A,B
MOV R3,A
CLR A
RLC A
XCH A,R2
MOV B,R6
MUL AB
ADD A,R3
MOV R3,A
MOV A,R2
ADDC A,B
MOV R2,A
RET
MOV A,R4
MOV R6,A
MOV A,R5
MOV R7,A
CALL HB2
HB2: CLR A
MOV R3,A
MOV R4,A
MOV R5,A
MOV R2,#10H
HB3: MOV A,R7
RLC A
MOV R7,A
MOV A,R6
RLC A
MOV R6,A
MOV A,R5
ADDC A,R5
DA A
MOV R5,A
MOV A,R4
ADDC A,R4
DA A
MOV R4,A
MOV A,R3
ADDC A,R3
MOV R3,A
DJNZ R2,HB2
RET
CBCD: MOV DISPBUF,R3
MOV A,R4 ;
ANL A,#0F0H
SWAP A
MOV DISPBUF+1,A
MOV A,R4
ANL A,#0FH
MOV DISPBUF+2,A
MOV A,R5
ANL A,#0F0H
SWAP A
MOV DISPBUF+3,A
MOV A,R5
ANL A,#0FH
MOV DISPBUF+4,A
CLR SpCalc
JMP LOOP
TIMER1: PUSH ACC
PUSH PSW
SETB RS0
JNB TR0,SETTR0
JMP GO1
SETTR0:
SETB TR0
GO1: INC SecCoun
MOV A,SecCoun
CJNE A,#251,Go2
CLR TR0
MOV SpCoun,TH0
MOV SpCoun+1,TL0
CLR A
MOV TH0,A
MOV TL0,A
SETB SpCalc
MOV SecCoun,#0
Go2: INC COUNT
MOV A,COUNT
CLR C
SUBB A,#6
JZ N1
JMP N2
N1: MOV COUNT,#0
N2: MOV A,#DISPBUF
ADD A,COUNT
MOV R0,A
MOV A,@R0
MOV DPTR,#DISPTAB
MOVC A,@A+DPTR
MOV P0,A
MOV A,COUNT
MOV DPTR,#BitTab
MOVC A,@A+DPTR
ORL P2,#11110000B
ANL P2,A
MOV TH1,#HIGH(65536-5000)
MOV TL1,#LOW(65536-5000)
POP PSW
POP ACC
SETB RS0
RETI
BitTab: DB 07Fh,0BFH,0DFH,0EFH,0F7H,0FBH
DISPTAB:DB 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90H
END
-
-
-
Desktop.zip
下载积分: 积分 -1 分
20.14 KB, 下载次数: 6, 下载积分: 积分 -1 分
仿真
一周热门 更多>