📄 ga600b.asm
字号:
.include "m128def.inc"
.def flag0=r8
.def flag1=r9
.def flag2=r10
.def flag3=r11
.def flag4=r12
.def flag5=r13
.def flag6=r14 ;点验状态
.def flag7=r15
;flag0,0 2ms
;flag0,1 钞票全过
;flag0,2 loop
;flag0,3 pcf8563
;flag0,4 开电机
;flag0,5 buff exchang
;flag0,6 紫外首幅错误
;flag0,7 紫外自检错误
;flag1,0 temp1
;flag1,1 temp2
;flag1,2 hop
;flag1,3 enc int
;flag1,4
;flag1,5
;flag1,6 首幅CNF
;flag1,7 首幅CF
;flag2,0 ir_a first dang
;flag2,1 ir_b
;flag2,2 ir_c
;flag2,3 ir_d
;flag2,4 ir_a pitch dang
;flag2,5 ir_b
;flag2,6 ir_c
;flag2,7 ir_d
;flag3,0 ir_la dang
;flag3,1 ir_lb
;flag3,2 ir_lc
;flag3,3 ir_ld
;flag3,4 ir_ra
;flag3,5 ir_rb
;flag3,6 ir_rc
;flag3,7 ir_rd
;flag4,0 ir_la lu
;flag4,1 ir_lb
;flag4,2 ir_lc
;flag4,3 ir_ld
;flag4,4 ir_ra
;flag4,5 ir_rb
;flag4,6 ir_rc
;flag4,7 ir_rd
;flag7,0 前张出错时,置位H
;flag7,1 前张出错时,挡计数管ir置位H
;flag7,2 前张出错时,挡红外计数管ird置位H
;flag7,3 前张出错时,挡中磁计数管irc置位H
;flag7,4 前张出错时,挡红外计数管irb置位H
;flag7,5 前张出错时,挡红外计数管ira置位H
;flag7,6
;flag7,7 出错时,临时位变量
.equ lcd_cs1 =7
.equ lcd_cs2 =6
.equ lcd_cs3 =5
.equ lcd_cs4 =4
.equ lcd_res =3
.equ lcd_e =2
.equ lcd_rw =1
.equ lcd_rs =0
.equ tlc1543_eoc =0
.equ tlc1543_clk =1
.equ tlc1543_add =2
.equ tlc1543_dat =3
.equ tlc1543_cs =4
.equ hc165_pl =4
.equ hc165_clk =5
.equ hc165_dat1 =6
.equ hc165_dat2 =7
.equ hc165_dat =2
.equ pcf8563_scl =0
.equ pcf8563_sda =1
;- - - - - - - - - - - - - - - - - - - -
;ram 0x100
.equ d_dx =0x100
.equ d_dy =0x101
.equ d_dz =0x102
.equ d_c =0x103
.equ d_b =0x104
.equ d_x =0x105
.equ d_y =0x106
.equ d_p =0x107
.equ dbuf1 =0x108
.equ dbuf2 =0x109
.equ dbuf3 =0x10a
.equ dbuf4 =0x10b
.equ dbuf5 =0x10c
.equ dbuf6 =0x10d
.equ dbuf7 =0x10e
.equ dbuf8 =0x10f
.equ keyv =0x110
.equ keyf =0x111
.equ pcur =0x113
.equ tp0 =0x114
.equ tp1 =0x115
.equ tp2 =0x116
.equ tp3 =0x117
.equ tp4 =0x118
.equ tp5 =0x119
.equ tp6 =0x11a
.equ tp7 =0x11b
.equ tp8 =0x11c
.equ tp9 =0x11d
.equ tp10 =0x11e
.equ tp11 =0x11f
.equ ad0v =0x120
.equ ad1v =0x121
.equ ad2v =0x122
.equ ad3v =0x123
.equ ad4v =0x124
.equ ad5v =0x125
.equ ad6v =0x126
.equ ad7v =0x127
.equ ad8v =0x128
.equ ad9v =0x129
.equ ad10v =0x12a
.equ ad11v =0x12b
.equ ad12v =0x12c
.equ ad13v =0x12d
.equ uadlv =0x12e
.equ uadrv =0x12f
.equ yuz =0x130
.equ yuzh =0x131
.equ dltmp =0x132
.equ sx =0x133
.equ countl =0x134
.equ counth =0x135
.equ countsl =0x136
.equ countsh =0x137
.equ twide =0x138
.equ twidew =0x139
.equ twidef =0x13a
.equ pitch =0x13b
.equ twidel =0x13c
.equ twider =0x13d
.equ twidex =0x13e
.equ twidey =0x13f
.equ dlmor0 =0x140
.equ dlmor1 =0x141
.equ dlmor2 =0x142
.equ dlmor3 =0x143
.equ excnt =0x144
.equ t2cnt =0x145
.equ detect =0x146
.equ dlr1 =0x147
.equ dlr2 =0x148
.equ dlr3 =0x149
.equ dlcntl =0x14a
.equ dlcnth =0x14b
.equ timl =0x14c
.equ timh =0x14d
.equ flv =0x159
.equ suv =0x160
.equ sip =0x161
.equ sir =0x162
.equ smm =0x163
.equ sbm =0x164
.equ syns =0x165
.equ keys =0x166
.equ errs =0x167
.equ dts =0x170
.equ dti =0x171
.equ dth =0x172
.equ dtd =0x173
.equ dtm =0x174
.equ dty =0x175
.equ speed =0x176
.equ fun1f =0x177
.equ fun2a =0x178
.equ fun3m =0x179
.equ fun4t =0x17a
.equ onth =0x180
.equ ontm =0x181
.equ offth =0x182
.equ offtm =0x183
.equ ontf =0x184
.equ offtf =0x185
.equ ontm_h =0x186
.equ ontm_m =0x187
.equ offtm_h =0x188
.equ offtm_m =0x189
.equ note =0x190
.equ notev =0x191
.equ notevh =0x192
.equ jin1b =0x193
.equ jin2b =0x194
.equ jin3b =0x195
.equ fpcnt =0x196
.equ errcnt =0x197
.equ errdisp =0x198
.equ wdadcnt =0x199
.equ ctr =0x19a
.equ canb =0x19b
.equ usdnote =0x19c
.equ xltmp =0x1a0
.equ xhtmp =0x1a1
.equ yltmp =0x1a2
.equ yhtmp =0x1a3
.equ zltmp =0x1a4
.equ zhtmp =0x1a5
.equ ir_c_cnt =0x1b0
.equ ir_b_cnt =0x1b1
.equ ir_d_cnt =0x1b2
.equ ir_a_cnt =0x1b3
.equ ir_aw =0x1c0
.equ ir_ap =0x1c1
.equ ir_law =0x1c2
.equ ir_raw =0x1c3
.equ ir_bw =0x1c4
.equ ir_bp =0x1c5
.equ ir_lbw =0x1c6
.equ ir_rbw =0x1c7
.equ ir_cw =0x1c8
.equ ir_cp =0x1c9
.equ ir_lcw =0x1ca
.equ ir_rcw =0x1cb
.equ ir_dw =0x1cc
.equ ir_dp =0x1cd
.equ ir_ldw =0x1ce
.equ ir_rdw =0x1cf
.equ ir_la_suml=0x1d0
.equ ir_la_sumh=0x1d1
.equ ir_lb_suml=0x1d2
.equ ir_lb_sumh=0x1d3
.equ ir_lc_suml=0x1d4
.equ ir_lc_sumh=0x1d5
.equ ir_ld_suml=0x1d6
.equ ir_ld_sumh=0x1d7
.equ ir_ra_suml=0x1d8
.equ ir_ra_sumh=0x1d9
.equ ir_rb_suml=0x1da
.equ ir_rb_sumh=0x1db
.equ ir_rc_suml=0x1dc
.equ ir_rc_sumh=0x1dd
.equ ir_rd_suml=0x1de
.equ ir_rd_sumh=0x1df
.equ ir_la_avg =0x1e0
.equ ir_lb_avg =0x1e1
.equ ir_lc_avg =0x1e2
.equ ir_ld_avg =0x1e3
.equ ir_ra_avg =0x1e4
.equ ir_rb_avg =0x1e5
.equ ir_rc_avg =0x1e6
.equ ir_rd_avg =0x1e7
.dseg
.org 0x200
mrl: .byte 1
mrr: .byte 1
mtb: .byte 1
mtd: .byte 1
mrl1: .byte 1
mrl2: .byte 1
mrr1: .byte 1
mrr2: .byte 1
mrtmp: .byte 1
wide: .byte 1
widel: .byte 1
wider: .byte 1
widef: .byte 1
.org 0x210
rirmlv: .byte 1
rirmrv: .byte 1
rirmluv: .byte 1
rirmruv: .byte 1
rirmldv: .byte 1
rirmrdv: .byte 1
ir_lc_blh: .byte 1
ir_rc_blh: .byte 1
mrsuml: .byte 1
mrsumh: .byte 1
mrl_f1: .byte 1
mrl_f2: .byte 1
mrl_f3: .byte 1
mrl_f4: .byte 1
mrr_f1: .byte 1
mrr_f2: .byte 1
mrr_f3: .byte 1
mrr_f4: .byte 1
mrl1_f1: .byte 1
mrl1_f2: .byte 1
mrl1_f3: .byte 1
mrl1_f4: .byte 1
mrr1_f1: .byte 1
mrr1_f2: .byte 1
mrr1_f3: .byte 1
mrr1_f4: .byte 1
mrl2_f1: .byte 1
mrl2_f2: .byte 1
mrl2_f3: .byte 1
mrl2_f4: .byte 1
mrr2_f1: .byte 1
mrr2_f2: .byte 1
mrr2_f3: .byte 1
mrr2_f4: .byte 1
mtd_f1: .byte 1
mtd_f2: .byte 1
mtd_f3: .byte 1
mtd_f4: .byte 1
mtb_f1: .byte 1
mtb_f2: .byte 1
mtb_f3: .byte 1
mtb_f4: .byte 1
mrl_d1: .byte 1
mrl_d2: .byte 1
mrr_d1: .byte 1
mrr_d2: .byte 1
mrl1_d1: .byte 1
mrl1_d2: .byte 1
mrr1_d1: .byte 1
mrr1_d2: .byte 1
mrl2_d1: .byte 1
mrl2_d2: .byte 1
mrr2_d1: .byte 1
mrr2_d2: .byte 1
cwide: .byte 1
cwidel: .byte 1
cwider: .byte 1
cpitch: .byte 1
chang: .byte 1
temp0: .byte 1
temp1: .byte 1
flag7t: .byte 1
.dseg
.org 0x300
ir_la: .byte 96
ir_lb: .byte 96
ir_lc: .byte 96
ir_ld: .byte 96
ir_ra: .byte 96
ir_rb: .byte 96
ir_rc: .byte 96
ir_rd: .byte 96
fl_a: .byte 96
mr_l: .byte 96
mr_r: .byte 96
mt_b: .byte 96
mt_d: .byte 96
mt_bw: .byte 192
ml_la: .byte 96
ml_lb: .byte 96
mr_la: .byte 96
mr_lb: .byte 96
ir_la1: .byte 96
ir_lb1: .byte 96
ir_lc1: .byte 96
ir_ld1: .byte 96
ir_ra1: .byte 96
ir_rb1: .byte 96
ir_rc1: .byte 96
ir_rd1: .byte 96
uv_r1: .byte 96
mt_b1: .byte 96
mt_d1: .byte 96
mt_bw1: .byte 192
;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
.eseg
.db 0x55,0xaa
ee_fun1f: .db 0x0
ee_fun2a: .db 0x0
ee_fun3m: .db 0x0
ee_fun4t: .db 0x0
ee_speed: .db 0x0
ee_keys: .db 0x0
ee_errs: .db 0x0
ee_suv: .db 0x05
ee_sip: .db 0x05
ee_sir: .db 0x05
ee_smm: .db 0x05
ee_sbm: .db 0x05
ee_syns: .db 0x05
ee_onth: .db 0x00
ee_ontm: .db 0x00
ee_ontf: .db 0x00
ee_offth: .db 0x00
ee_offtm: .db 0x00
ee_offtf: .db 0x00
;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
.cseg
.org $0000
jmp reset ; reset handler
jmp ext_int0 ; irq0 handler
jmp ext_int1 ; irq1 handler
jmp ext_int2 ; irq2 handler
jmp ext_int3 ; irq3 handler
jmp ext_int4 ; irq4 handler
jmp ext_int5 ; irq5 handler
jmp ext_int6 ; irq6 handler
jmp ext_int7 ; irq7 handler
jmp tim2_comp ; timer2 compare handler
jmp tim2_ovf ; timer2 overflow handler
jmp tim1_capt ; timer1 capture handler
jmp tim1_compa ; timer1 comparea handler
jmp tim1_compb ; timer1 compareb handler
jmp tim1_ovf ; timer1 overflow handlerf
jmp tim0_comp ; timer0 compare handler
jmp tim0_ovf ; timer0 overflow handler
jmp spi_stc ; spi transfer complete handler
jmp usart0_rxc ; usart0 rx complete handler
jmp usart0_dre ; usart0,udr empty handler
jmp usart0_txc ; usart0 tx complete handler
jmp adc_cc ; adc conversion complete handler
jmp ee_rdy ; eeprom ready handler
jmp ana_comp ; analog comparator handler
jmp tim1_compc ; timer1 comparec handler
jmp tim3_capt ; timer3 capture handler
jmp tim3_compa ; timer3 comparea handler
jmp tim3_compb ; timer3 compareb handler
jmp tim3_compc ; timer3 comparec handler
jmp tim3_ovf ; timer3 overflow handler
jmp usart1_rxc ; usart1 rx complete handler
jmp usart1_dre ; usart1,udr empty handler
jmp usart1_txc ; usart1 tx complete handler
jmp twi ; two-wire serial interface interrupt handler
jmp spm_rdy ; spm ready handler
ereset: jmp start
pver: .db 0x00,0x07,0x0,0x0
.include "tab.inc"
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ext_int0: nop ;irq0 isr
reti
ext_int1: nop ; irq1 isr
reti
ext_int2: nop ; irq2 isr
reti
ext_int3: nop ; irq3 isr
reti
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ext_int4: ; irq4 isr
in r24,sreg
lds r25,twide
inc r25
sts twide,r25
lds r25,excnt
inc r25
sts excnt,r25
set
bld flag1,3
out sreg,r24
reti
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ext_int5: nop ; irq5 isr
reti
ext_int6: nop ; irq6 isr
reti
ext_int7: nop ; irq7 isr
reti
tim2_comp: nop ; timer2 compare isr
reti
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
tim2_ovf: ; timer2 overflow isr
push r16
in r24,sreg
ldi r25,90
out tcnt2,r25
lds r25,t2cnt
inc r25
sts t2cnt,r25
;- - - - - -
tim2_ovf10:
sbic pine,5
rjmp tim2_ovf19
lds r25,mrl
inc r25
sts mrl,r25
lds r25,ir_ldw
cpi r25,2
brsh tim2_ovf11
rjmp tim2_ovf19
tim2_ovf11:
cpi r25,15
brsh tim2_ovf12
lds r25,mrl_f1
inc r25
sts mrl_f1,r25
rjmp tim2_ovf19
tim2_ovf12:
cpi r25,29
brsh tim2_ovf13
lds r25,mrl_f2
inc r25
sts mrl_f2,r25
rjmp tim2_ovf19
tim2_ovf13:
cpi r25,43
brsh tim2_ovf14
lds r25,mrl_f3
inc r25
sts mrl_f3,r25
rjmp tim2_ovf19
tim2_ovf14:
cpi r25,57
brsh tim2_ovf15
lds r25,mrl_f4
inc r25
sts mrl_f4,r25
rjmp tim2_ovf19
tim2_ovf15:
tim2_ovf19:
nop
;- - - - - -
tim2_ovf20:
sbic pine,6
rjmp tim2_ovf29
lds r25,mrr
inc r25
sts mrr,r25
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -