?? int.asm.bak
字號(hào):
;************************************************
;Name :InterruptSub
;Function:
;Input :
;Output :
;Register Used:
;*************************************************
InterruptSub:
XCH A,AccBuf
XCH A,PFLAG
B0MOV PflagBuf,A
b0bts0 FTC0IRQ ;//Analyse the Interrupt resourc
jmp TC0INTR
b0bts0 ft0irq
jmp t0intr
b0bts0 FP00IRQ
jmp P00INTR
Interrupt90:
XCH A,PflagBuf
B0MOV PFLAG,A
XCH A,AccBuf ;//For release the Acc And Pflag
RETI
;--------------------------------------------------------
;--------------------------------------------------------
TC0INTR:
incms timer1800us
nop
bts1 ptwing
jmp mnint000
mov a,timer1800us
sub a,#6
bts1 fc
jmp mnint00
bset t1800usflag
clr timer1800us
jmp mnint00
mnint000:
mov a,timer1800us
sub a,#84
bts1 fc
jmp mnint00
bset t18msflag
clr timer1800us
mnint00:
incms timer5ms
nop
mov a,timer5ms
sub a,#25
bts1 fc
jmp TC0INTR90
bset t5msflag
clr timer5ms
bset t5msflag1
bset t5msflag2
bset t5msflag3
bset t5msflag4
TC0INTR90:
b0bclr FTC0IRQ
jmp Interrupt90
;--------------------------------------------------------
;--------------------------------------------------------
t0intr:
mov a,#6
sub a,levecount
bts0 fc
jmp t0intr10
bset errorflag
jmp t0intr90
t0intr10:
incms levecount
nop
t0intr90:
bclr ft0irq
jmp interrupt90
;--------------------------------------------------------
;--------------------------------------------------------
P00INTR:
bclr fp00irq
bclr ft0enb
mov a,t0c
bts1 singleflag
jmp disasm100
mov level,a ;上升沿進(jìn)入
jmp disasm200
disasm100:
mov leveh,a ;下降沿進(jìn)入
jmp disasm200
disasm200:
clr t0c
bset ft0enb
bts0 singleflag
jmp disasm220
jmp disasm210
disasm210:
@p00_edge 1 ;下降沿進(jìn)入,設(shè)為上升沿中斷
bts0 firstflag
jmp disasm221
mov a,levecount
bts0 fz
jmp disasm80
bset firstflag
clr levecount
clr inputcount
jmp disasm90
disasm220:
@p00_edge 2 ;上升沿進(jìn)入,設(shè)為下降沿中斷
mov a,#56 ;448us=8x56
sub a,level
bts0 fc
jmp disasm80 ;小于448us,出錯(cuò)
mov a,#75 ;600us=8x75
sub a,level
bts0 fc
jmp disasm90 ;小于600us,返回
jmp disasm80 ;大于600us,出錯(cuò)
disasm221:
clr tablecount
incms inputcount
nop
mov a,inputcount
sub a,#5
bts1 fc
jmp chksignaltable
jmp disasm80
chksignaltable: ;查詢控制信號(hào)的檔位
b0mov y,#signaltable$m
b0mov z,#signaltable$l
mov a,tablecount
add z,a
mov a,#0
adc y,a
movc
sub a,leveh
bts0 fc
jmp chksignaltableend
jmp signaltableadd
signaltableadd:
incms tablecount
nop
jmp chksignaltable
chksignaltableend:
mov a,tablecount
bts0 fz
jmp disasm80 ;error
sub a,#11
bts0 fc
jmp disasm80 ;error
mov a,tablecount
mov gearbuf,a
mov a,inputcount
@jmp_a 5
jmp disasm90
jmp gearwing
jmp gearempennage
jmp gearscrew
jmp gearswing
gearwing:
mov a,gearbuf
cmprs a,wingbuf1
jmp gearwing10
incms samebuf1
nop
mov a,samebuf1
sub a,samecontant
bts1 fc
jmp disasm90
mov a,wingbuf1
mov wingbuf,a
jmp disasm90
gearwing10:
mov a,gearbuf
mov wingbuf1,a
clr samebuf1
jmp disasm90
gearempennage:
mov a,gearbuf
cmprs a,empennagebuf1
jmp gearempennage10
incms samebuf2
nop
mov a,samebuf2
sub a,samecontant
bts1 fc
jmp disasm90
mov a,empennagebuf1
mov empennagebuf,a
jmp disasm90
gearempennage10:
mov a,gearbuf
mov empennagebuf1,a
clr samebuf2
jmp disasm90
gearscrew:
mov a,gearbuf
cmprs a,screwbuf1
jmp gearscrew10
incms samebuf3
nop
mov a,samebuf3
sub a,samecontant
bts1 fc
jmp disasm90
mov a,screwbuf1
mov screwbuf,a
jmp disasm90
gearscrew10:
mov a,gearbuf
mov screwbuf1,a
clr samebuf3
jmp disasm90
gearswing:
mov a,gearbuf
cmprs a,swingbuf1
jmp gearswing10
incms samebuf4
nop
mov a,samebuf4
sub a,samecontant
bts1 fc
jmp disasm90
mov a,swingbuf1
mov swingbuf,a
jmp disasm90
gearswing10:
mov a,gearbuf
mov swingbuf1,a
clr samebuf4
jmp disasm90
disasm80:
@p00_edge 2 ;出錯(cuò),設(shè)為下降沿中斷
clr inputcount
clr levecount
bclr firstflag
disasm90:
P00INTR90:
jmp Interrupt90
;***********************************************
mnint:
bts1 t5msflag
jmp mnint90
bclr t5msflag
call dkeychat
mnint10:
incms timer500ms
nop
mov a,timer500ms
sub a,#100
bts1 fc
jmp mnint90
clr timer500ms
bset t500msflag
mnint90:
ret
;***********************************************
signaltable:
dw 030h ;0
dw 03fh ;1
dw 04fh ;2
dw 05eh ;3
dw 06eh ;4
dw 07dh ;5
dw 08dh ;6
dw 09ch ;7
dw 0ach ;8
dw 0bbh ;9
dw 0cbh ;10
dw 0ffh ;11
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -