免电源的电话使用计时器
好像没在正常工作,总是怀疑成品是死的,好吧,再动些手脚将秒的闪烁呈现在七段的小数点上以满足动感要求。
TC5.ICE
;
; FILE NAME:TC5.DT
; DATE :1999,5,5
; BY :HWANG JYN_GUO
;
; FUNCTION DESCRIPTION:
; USING TCC TO GET 1 SEC INTERRUPT
; 32768/(2*64*256)= 1 SEC
; CRYSTAL MODE 32768 Hz
; 2 CYCLE AND 2 CLOCK MODE
;
PC == 02
RF == 03 ;STATUS
FZ == 02 ;FLAG OF ZERO
FC == 00 ;FLAG OF CARRY
P5 == 0X05 ;PORT 5
P6 == 0X06 ;PORT 6
DL == 0X10 ;DELAY LOOP
MIN == 0X11 ;MINUTE
SEC == 0X12 ;SECOND
DD == 0X13 ;DISPLAY DIGIT
DDH == 0X14 ;DISPLAY DIGIT HIGH
AB == 0X15 ;A BACK_UP
RFB == 0X16 ;RF BACK_UP
FG == 0X17 ;FLAG
ORG 0
0000 JMP INIT ;PROGRAM START
ORG 8
;TCC INTERRUPT---------------------------------------------------------------
TCCI:
0008 MOV AB,A ;AB <- A
0009 SWAP AB ;AB <- BA
000A SWAPA RF
000B MOV RFB,A ;RFB<- FR
000C COM FG
000D INC SEC
CHECK:
000E MOV A,SEC
000F SUB A,@59 ;59-SEC=A
0010 JBC RF,FC
0011 JMP C_MIN
0012 CLR SEC
0013 INC MIN
C_MIN:
0014 MOV A,MIN
0015 SUB A,@99 ;99-MIN=A
0016 JBS RF,FC
0017 CLR MIN
TCCE:
0018 SWAPA RFB
0019 MOV RF,A ;RF<- RFB
001A SWAPA AB ;A <- BA
001B BC 0X0F,0 ;CLEAR TCC_INT
001C RETI
;TABLE 7 SEGEMENT------------------------------------------------------
T7:
001D CALL TABLE ;用来增加小数点闪烁
001E JBC FG,00
001F XOR A,@0X80
0020 RET
;TABLE -------------------------------------------------------------------------
TABLE:
0021 ADD PC,A ; GFE DCBA
0022 RETL @0B01000000& 《免电源的电话使用计时器(第12页)》
本文链接地址:http://www.oyaya.net/fanwen/view/146413.html
TC5.ICE
;
; FILE NAME:TC5.DT
; DATE :1999,5,5
; BY :HWANG JYN_GUO
;
; FUNCTION DESCRIPTION:
; USING TCC TO GET 1 SEC INTERRUPT
; 32768/(2*64*256)= 1 SEC
; CRYSTAL MODE 32768 Hz
; 2 CYCLE AND 2 CLOCK MODE
;
PC == 02
RF == 03 ;STATUS
FZ == 02 ;FLAG OF ZERO
FC == 00 ;FLAG OF CARRY
P5 == 0X05 ;PORT 5
P6 == 0X06 ;PORT 6
DL == 0X10 ;DELAY LOOP
MIN == 0X11 ;MINUTE
SEC == 0X12 ;SECOND
DD == 0X13 ;DISPLAY DIGIT
DDH == 0X14 ;DISPLAY DIGIT HIGH
AB == 0X15 ;A BACK_UP
RFB == 0X16 ;RF BACK_UP
FG == 0X17 ;FLAG
ORG 0
0000 JMP INIT ;PROGRAM START
ORG 8
;TCC INTERRUPT---------------------------------------------------------------
TCCI:
0008 MOV AB,A ;AB <- A
0009 SWAP AB ;AB <- BA
000A SWAPA RF
000B MOV RFB,A ;RFB<- FR
000C COM FG
000D INC SEC
CHECK:
000E MOV A,SEC
000F SUB A,@59 ;59-SEC=A
0010 JBC RF,FC
0011 JMP C_MIN
0012 CLR SEC
0013 INC MIN
C_MIN:
0014 MOV A,MIN
0015 SUB A,@99 ;99-MIN=A
0016 JBS RF,FC
0017 CLR MIN
TCCE:
0018 SWAPA RFB
0019 MOV RF,A ;RF<- RFB
001A SWAPA AB ;A <- BA
001B BC 0X0F,0 ;CLEAR TCC_INT
001C RETI
;TABLE 7 SEGEMENT------------------------------------------------------
T7:
001D CALL TABLE ;用来增加小数点闪烁
001E JBC FG,00
001F XOR A,@0X80
0020 RET
;TABLE -------------------------------------------------------------------------
TABLE:
0021 ADD PC,A ; GFE DCBA
0022 RETL @0B01000000& 《免电源的电话使用计时器(第12页)》