?? 綜合a.lst
字號:
000046 9a95 sbi portd,$05
000047 95a8 BUSY1: WDR
000048 99b7 SBIC PINB,$07
000049 c001 RJMP LED
00004a c4b5 RJMP LCD
00004b 2444 LED: clr r4
00004c 2455 clr r5
00004d 2466 clr r6
00004e 2477 clr r7
00004f 27ff clr zh
000050 27bb clr xh
000051 27dd clr yh
000052 d30a rcall indipram ;調(diào)用初始化顯示內(nèi)存。
000053 e007 scanad: ldi temp,$07
000054 e6c0 ldi yl,$60
000055 d314 scann: rcall scan1
000056 f3f6 brts scann
000057 d312 scank: rcall scan1
000058 f7f6 brtc scank
000059 d310 rcall scan1
00005a 9488 scans: clc
00005b 3180 cpi keyn,$10
00005c f428 brcc commkey
00005d d2cd rcall wraddram
00005e 950a dec temp
00005f 3003 cpi temp,$03
000060 f7a1 brne scann
000061 cff1 rjmp scanad
000062 0000 commkey: nop
000063 3183 cpi keyn,$13
000064 f259 breq reset
000065 3182 cpi keyn,$12
000066 f029 breq srmem
000067 3181 cpi keyn,$11
000068 f021 breq epmem
000069 3180 cpi keyn,$10
00006a f019 breq directt
00006b cfe9 rjmp scann
00006c c079 srmem: rjmp srmemt
00006d c001 epmem: rjmp epmemt
00006e c116 directt: rjmp direct
00006f d120 epmemt: rcall meradd ;調(diào)用由R7-R4產(chǎn)生的地址入TEMP2TEMP1。
000070 3022 cpi temp2,$02 ;EEPROM必須小于0200H。
000071 f018 brcs epdown
000072 e021 ldi temp2,$01
000073 ef1f ldi temp1,$ff
000074 d122 rcall dviadd
000075 bb2f epdown:out eearh,temp2
000076 bb1e out eearl,temp1
000077 9ae0 sbi eecr,$00
000078 b31d in temp1,eedr
000079 2e21 mov r2,temp1
00007a 2e81 mov r8,temp1
00007b d101 rcall dtor32 ;數(shù)據(jù)放入R3R2中。
00007c d0e3 rcall disbyreg ;改變顯示內(nèi)存。
00007d 27dd clr yh
00007e e6c4 ldi yl,$64
00007f 8108 ld temp,y
000080 e810 ldi temp1,$80
000081 0f01 add temp,temp1
000082 8308 st y,temp
000083 d2e6 epscann:rcall scan1 ;鍵掃
000084 f3f6 brts epscann
000085 d2e4 epscank:rcall scan1
000086 f7f6 brtc epscank
000087 d2e2 rcall scan1
000088 3183 epscans:cpi keyn,$13
000089 f409 brne epreturn
00008a cfa5 rjmp reset
00008b 3180 epreturn:cpi keyn,$10
00008c f4d8 brcc epcommkey
00008d 2e38 mov r3,keyn
00008e d0d1 rcall disbyreg
00008f 27dd clr yh
000090 e6c5 ldi yl,$65
000091 8108 ld temp,y
000092 e810 ldi temp1,$80
000093 0f01 add temp,temp1
000094 8308 st y,temp
000095 d2d4 escann:rcall scan1
000096 f3f6 brts escann
000097 d2d2 escank:rcall scan1
000098 f7f6 brtc escank
000099 d2d0 rcall scan1
00009a 3183 escans:cpi keyn,$13
00009b f409 brne ereturn
00009c cf93 rjmp reset
00009d 3180 ereturn:cpi keyn,$10
00009e f488 brcc ecommkey
00009f 2e28 mov r2,keyn
0000a0 d0bf rcall disbyreg
0000a1 27dd clr yh
0000a2 e6c4 ldi yl,$64
0000a3 8108 ld temp,y
0000a4 e810 ldi temp1,$80
0000a5 0f01 add temp,temp1
0000a6 8308 st y,temp
0000a7 cfdb rjmp epscann
0000a8 3183 epcommkey:cpi keyn,$13
0000a9 f409 brne epreturn1
0000aa cf85 rjmp reset
0000ab 318e epreturn1:cpi keyn,$1e
0000ac f059 breq eplastkey
0000ad 318f cpi keyn,$1f
0000ae f101 breq epnextkey
0000af cfd3 rjmp epscann
0000b0 3183 ecommkey:cpi keyn,$13
0000b1 f409 brne ereturn1
0000b2 cf7d rjmp reset
0000b3 318e ereturn1:cpi keyn,$1e
0000b4 f019 breq eplastkey
0000b5 318f cpi keyn,$1f
0000b6 f0c1 breq epnextkey
0000b7 cfdd rjmp escann
0000b8 d0d7 eplastkey:rcall meradd
0000b9 2d03 mov temp,r3
0000ba 9502 swap temp
0000bb 2902 or temp,r2
0000bc 1508 cp temp,r8
0000bd f039 breq eplast
0000be 98e0 cbi eecr,$00
0000bf bb2f out eearh,temp2
0000c0 bb1e out eearl,temp1
0000c1 9ae2 sbi eecr,$02
0000c2 9ae1 sbi eecr,$01
0000c3 99e1 epwrwt: sbic eecr,$01
0000c4 cffe rjmp epwrwt
0000c5 3010 eplast: cpi temp1,$00
0000c6 f419 brne eplastkey1
0000c7 3020 cpi temp2,$00
0000c8 f409 brne eplastkey1
0000c9 cfb9 rjmp epscann
0000ca 9488 eplastkey1:clc
0000cb 5011 subi temp1,$01
0000cc 4020 sbci temp2,$00
0000cd d0c9 rcall dviadd
0000ce cfa0 rjmp epmemt
0000cf d0c0 epnextkey:rcall meradd
0000d0 2d03 mov temp,r3
0000d1 9502 swap temp
0000d2 2902 or temp,r2
0000d3 1508 cp temp,r8
0000d4 f039 breq epnext
0000d5 98e0 cbi eecr,$00
0000d6 bb2f out eearh,temp2
0000d7 bb1e out eearl,temp1
0000d8 9ae2 sbi eecr,$02
0000d9 9ae1 sbi eecr,$01
0000da 99e1 epwrwtn:sbic eecr,$01
0000db cffe rjmp epwrwtn
0000dc 3f1f epnext: cpi temp1,$ff
0000dd f419 brne epnextkey1
0000de 3021 cpi temp2,$01
0000df f409 brne epnextkey1
0000e0 cfa2 rjmp epscann
0000e1 9513 epnextkey1:inc temp1
0000e2 f409 brne epnextkey2
0000e3 9523 inc temp2
0000e4 d0b2 epnextkey2:rcall dviadd
0000e5 cf89 rjmp epmemt ;整段EEPROM讀寫結(jié)束。
0000e6 d0a9 srmemt: rcall meradd ;調(diào)用由R7-R4產(chǎn)生的地址入TEMP2TEMP1。
0000e7 3022 cpi temp2,$02
0000e8 f438 brcc srbegin
0000e9 3021 cpi temp2,$01
0000ea f039 breq srdown
0000eb 3710 cpi temp1,$70
0000ec f428 brcc srdown
0000ed e710 ldi temp1,$70
0000ee 2722 clr temp2
0000ef c002 rjmp srdown
0000f0 e021 srbegin:ldi temp2,$01
0000f1 ef1f ldi temp1,$ff
0000f2 d0a4 srdown: rcall dviadd
0000f3 d09c rcall meradd
0000f4 2fd2 mov yh,temp2
0000f5 2fc1 mov yl,temp1
0000f6 8118 ld temp1,y
0000f7 2e21 mov r2,temp1
0000f8 2e81 mov r8,temp1
0000f9 d083 rcall dtor32 ;數(shù)據(jù)放入R3R2中。
0000fa d065 rcall disbyreg ;改變顯示內(nèi)存。
0000fb 27dd clr yh
0000fc e6c4 ldi yl,$64
0000fd 8108 ld temp,y
0000fe e810 ldi temp1,$80
0000ff 0f01 add temp,temp1
000100 8308 st y,temp
000101 d268 srscann:rcall scan1 ;鍵掃
000102 f3f6 brts srscann
000103 d266 srscank:rcall scan1
000104 f7f6 brtc srscank
000105 d264 rcall scan1
000106 3183 srscans:cpi keyn,$13
000107 f409 brne srreturn
000108 cf27 rjmp reset
000109 3180 srreturn:cpi keyn,$10
00010a f4d8 brcc srcommkey
00010b 2e38 mov r3,keyn
00010c d053 rcall disbyreg
00010d 27dd clr yh
00010e e6c5 ldi yl,$65
00010f 8108 ld temp,y
000110 e810 ldi temp1,$80
000111 0f01 add temp,temp1
000112 8308 st y,temp
000113 d256 sscann:rcall scan1
000114 f3f6 brts sscann
000115 d254 sscank:rcall scan1
000116 f7f6 brtc sscank
000117 d252 rcall scan1
000118 3183 sscans:cpi keyn,$13
000119 f409 brne sreturn
00011a cf15 rjmp reset
00011b 3180 sreturn:cpi keyn,$10
00011c f488 brcc scommkey
00011d 2e28 mov r2,keyn
00011e d041 rcall disbyreg
00011f 27dd clr yh
000120 e6c4 ldi yl,$64
000121 8108 ld temp,y
000122 e810 ldi temp1,$80
000123 0f01 add temp,temp1
000124 8308 st y,temp
000125 cfdb rjmp srscann
000126 3183 srcommkey:cpi keyn,$13
000127 f409 brne srreturn1
000128 cf07 rjmp reset
000129 318e srreturn1:cpi keyn,$1e
00012a f059 breq srlastkey
00012b 318f cpi keyn,$1f
00012c f0f1 breq srnextkey
00012d cfd3 rjmp srscann
00012e 3183 scommkey:cpi keyn,$13
00012f f409 brne srreturn2
000130 ceff rjmp reset
000131 318e srreturn2:cpi keyn,$1e
000132 f019 breq srlastkey
000133 318f cpi keyn,$1f
000134 f0b1 breq srnextkey
000135 cfdd rjmp sscann
000136 d059 srlastkey:rcall meradd
000137 2d03 mov temp,r3
000138 9502 swap temp
000139 2902 or temp,r2
00013a 1508 cp temp,r8
00013b f029 breq srlast
00013c 2fd2 mov yh,temp2
00013d 2fc1 mov yl,temp1
00013e 8308 st y,temp
00013f 0000 nop
000140 0000 nop
000141 3710 srlast: cpi temp1,$70
000142 f419 brne srlastkey1
000143 3020 cpi temp2,$00
000144 f409 brne srlastkey1
000145 cfbb rjmp srscann
000146 9488 srlastkey1:clc
000147 5011 subi temp1,$01
000148 4020 sbci temp2,$00
000149 d04d rcall dviadd
00014a cf9b rjmp srmemt
00014b d044 srnextkey:rcall meradd
00014c 2d03 mov temp,r3
00014d 9502 swap temp
00014e 2902 or temp,r2
00014f 1508 cp temp,r8
000150 f029 breq srnext
000151 2fd2 mov yh,temp2
000152 2fc1 mov yl,temp1
000153 8308 st y,temp
000154 0000 nop
000155 0000 nop
000156 3f1f srnext: cpi temp1,$ff
000157 f419 brne srnextkey1
000158 3021 cpi temp2,$01
000159 f409 brne srnextkey1
00015a cfa6 rjmp srscann
00015b 9513 srnextkey1:inc temp1
00015c f409 brne srnextkey2
00015d 9523 inc temp2
00015e d038 srnextkey2:rcall dviadd
00015f cf86 rjmp srmemt ;整段EEPROM讀寫結(jié)束。
000160 e027 disbyreg: ldi temp2,$07 ;調(diào)用通過R7-R2取顯示字符入顯示內(nèi)存。
000161 e6c0 ldi yl,$60
000162 27dd clr yh
000163 2fe2 disbyreg1:mov zl,temp2
000164 27ff clr zh
000165 8130 ld temp3,z
000166 2fe3 mov zl,temp3
000167 e1fe ldi zh,high(label*2)
000168 95c8 lpm
000169 952a dec temp2
00016a 9209 st y+,r0
00016b 36c6 cpi yl,$66
00016c f7b1 brne disbyreg1
00016d 9508 ret
00016e e027 disbyregc: ldi temp2,$07 ;調(diào)用通過R7-R2取顯示字符入顯示內(nèi)存。
00016f e6c0 ldi yl,$60
000170 27dd clr yh
000171 2fe2 disbyregc1:mov zl,temp2
000172 27ff clr zh
000173 8130 ld temp3,z
000174 e2e0 ldi zl,low(labelc*2)
000175 e1fe ldi zh,high(labelc*2)
000176 0fe3 add zl,temp3
000177 95c8 lpm
000178 952a dec temp2
000179 9209 st y+,r0
00017a 36c6 cpi yl,$66
00017b f7a9 brne disbyregc1
00017c 9508 ret
00017d 2d12 dtor32: mov temp1,r2
00017e 7f10 andi temp1,$f0 ;數(shù)據(jù)放入R3R2中。
00017f 9512 swap temp1
000180 2e31 mov r3,temp1
000181 2d12 mov temp1,r2
000182 701f andi temp1,$0f
000183 2e21 mov r2,temp1
000184 9508 ret
000185 2d15 direct: mov temp1,r5
000186 9512 swap temp1
000187 2914 or temp1,r4
000188 931f push temp1
000189 2d17 mov temp1,r7
00018a 9512 swap temp1
00018b 2916 or temp1,r6
00018c 931f push temp1
00018d 95c8 lpm
00018e 9403 inc r0
00018f 9508 ret
000190 2d15 meradd: mov temp1,r5
000191 9512 swap temp1
000192 2914 or temp1,r4
000193 2d27 mov temp2,r7
000194 9522 swap temp2
000195 2926 or temp2,r6
000196 9508 ret
000197 2e72 dviadd: mov r7,temp2
000198 702f andi temp2,$0f
000199 2e62 mov r6,temp2
00019a 2d27 mov temp2,r7
00019b 7f20 andi temp2,$f0
00019c 9522 swap temp2
00019d 2e72 mov r7,temp2
00019e 2e51 mov r5,temp1
00019f 701f andi temp1,$0f
0001a0 2e41 mov r4,temp1
0001a1 2d15 mov temp1,r5
0001a2 7f10 andi temp1,$f0
0001a3 9512 swap temp1
0001a4 2e51 mov r5,temp1
0001a5 9508 ret
.org $0200 ;音樂程序
000200 e50f ldi temp,low(RAMEND) ;
000201 bf0d out SPL,temp
000202 e002 ldi temp,high(RAMEND)
000203 bf0e out SPL+1,temp
000204 95a8 wdr
000205 e00f ldi temp,$0f
000206 bd01 out WDTCR,temp
000207 e060 ldi musn,$00
000208 e000 ldi temp,$00
000209 bd0f out tccr1a,temp
00020a bd0e out tccr1b,temp
00020b e002 ldi temp,$02
00020c 9300 0100 sts $0100,temp
00020e 94f8 LEDA: cli
00020f e800 ldi r16,0b10000000
000210 bf09 out timsk,r16
000211 ef0f ldi temp,$ff
000212 bb04 out ddrc,temp
000213 ef0f ldi temp,0b11111111
000214 bb05 out portc,temp
000215 2722 clr temp2
000216 2711 clr temp1
000217 e0a2 ldi scntt,$02
000218 2777 clr tonlng
000219 95a8 startp:wdr
00021a e1fe ldi zh,HIGH(PLYTAB*2)
00021b e4e0 LDI ZL,LOW(PLYTAB*2)
00021c 95c8 nexmut:lpm
00021d 2d90 mov plyton,r0
00021e 9001 ld r0,z+
00021f 95c8 lpm
000220 2d70 mov tonlng,r0
000221 2a09 or r0,plyton
000222 9001 ld r0,z+
000223 f421 brne playm
000224 e000 ldi temp,$00
000225 bd0e out tccr1b,temp
000226 94f8 cli
000227 cff1 rjmp startp
000228 93ff playm:push zh
000229 93ef push zl
00022a 2399 tst plyton
00022b f0a9 breq mustd
00022c e1ff ldi zh,high(mustab*2)
00022d ebe4 ldi zl,low(mustab*2)
00022e 2f09 mov temp,plyton
00022f 950a dec temp
000230 0f00 lsl temp
000231 0fe0 add zl,temp
000232 e000 ldi temp,$00
000233 1ff0 adc zh,temp
000234 95c8 lpm
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -