⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 slavr73a.lst

📁 单片机开发资料光盘-双龙-686M.zip
💻 LST
📖 第 1 页 / 共 5 页
字号:
000235 2d50               mov   tonl,r0
000236 bc0c               out   tcnt1l,r0
000237 9001               ld    r0,z+
000238 95c8               lpm
000239 2d40               mov   tonh,r0
00023a bc0d               out   tcnt1h,r0
00023b 91ef               pop   zl
00023c 91ff               pop   zh
00023d 9100 0100          lds   temp,$0100
00023f bd0e               out   tccr1b,temp
000240 9478               sei
000241 d003        mustd:rcall   plydel
000242 957a              dec   tonlng
000243 f7e9              brne  mustd
000244 cfd7              rjmp  nexmut
000245 eb09        plydel:ldi  temp,185
000246 e014          dt3:ldi   temp1,04
000247 ef2a          dt2:ldi   temp2,250
000248 95a8          dt1:wdr  
000249 95a8              wdr
00024a 95a8              wdr
00024b 95a8              wdr
00024c 95a8              wdr
00024d 952a              dec   temp2
00024e f7c9              brne  dt1
00024f 951a              dec   temp1
000250 f7b1              brne  dt2
000251 950a              dec   temp
000252 f799              brne  dt3
000253 9508              ret
          .org $0300				;8字循环程序。
000300 d05c              	rcall indipram
000301 e70f                dip8:	ldi temp,$7f		;8字循环显示程序.		
000302 d047      		rcall routdip      	           
000303 cffd      		rjmp dip8
           .org $0320	
000320 d03c      		rcall indipram		;0-f循环显示程序.
000321 27ee      	   aa5: clr zl
000322 e1fe         		ldi zh,high(label*2)
000323 e6c0      		ldi yl,$60
000324 95c8       	   aa4: lpm
000325 2d00      	 	mov temp,r0
000326 9001      	 	ld r0,z+
000327 31e1      	 	cpi zl,$11
000328 f3c1      	 	breq aa5
000329 d020      		rcall routdip
00032a cff9      		rjmp aa4
00032b 930f        wraddram:	push temp
00032c 27ff      		clr zh			;读键存入显示内存及寄存器中。
00032d 2fe0      		mov zl,temp
00032e 8380      		st z,keyn
00032f e1fe      		ldi zh,high(label*2)
000330 2fe8      		mov zl,keyn
000331 95c8      		lpm	
000332 9209      		st y+,r0
000333 36c4      		cpi yl,$64
000334 f409      		brne pointc
000335 e6c0      		ldi yl,$60
000336 8128      	pointc:	ld temp2,y
000337 e830      		ldi temp3,$80
000338 0f23      		add temp2,temp3
000339 8328      		st y,temp2
00033a 910f      		pop temp		
00033b 9508      		ret
00033c 930f      wraddramc:	push temp
00033d 27ff      		clr zh			;读键存入显示内存及寄存器中。
00033e 2fe0      		mov zl,temp
00033f 8380      		st z,keyn
000340 e1fe      		ldi zh,high(labelc*2)
000341 e2e0      		ldi zl,low(labelc*2)
000342 0fe8      		add zl,keyn
000343 95c8      		lpm	
000344 9209      		st y+,r0
000345 36c4      		cpi yl,$64
000346 f409      		brne pointcc
000347 e6c0      		ldi yl,$60
000348 910f      	pointcc:pop temp
000349 9508      		ret
00034a 27dd       routdip:	clr yh			;循环显示程序。
00034b e6c0      		ldi yl,$60
00034c e810      	   aa1:	ldi temp1,$80		
00034d 0000              	nop
00034e 8308      	   	st y,temp
00034f d01a      	   aa2: rcall scan1
000350 951a      	  	dec temp1
000351 f7e9      	 	brne aa2
000352 930f      	 	push temp
000353 e110      	 	ldi temp1,$10
000354 2700      	 	clr temp
000355 9309      	 	st y+,temp
000356 d013                 aa3: rcall scan1
000357 951a      	        dec temp1 
000358 f7e9      	 	brne aa3
000359 910f      	 	pop temp
00035a 36c6               	cpi yl,$66
00035b f781      	 	brne aa1
00035c 9508      		ret
00035d e1fe       indipram:	ldi zh,high(label*2)	;初始化显示内存。
00035e e0e0      	 	ldi zl,low(label*2)
00035f e6a0      		ldi xl,$60
000360 ef03      		ldi temp,$f3
000361 930d      		st x+,temp
000362 2700      		clr temp
000363 2711      		clr temp1
000364 930d                inlp:	st x+,temp
000365 9513      		inc temp1
000366 3015       	 	cpi temp1,$05
000367 f7e1      		brne inlp
000368 e6a0      		ldi xl,$60
000369 9508      	 	ret
00036a 93bf       SCAN1:	        push xh			;键扫显示子程序。
00036b 93af      		PUSH XL
00036c 933f      		PUSH TEMP3
00036d 932f      		PUSH TEMP2
00036e 931f      		PUSH TEMP1
00036f 930f      		PUSH TEMP
000370 e6a0      	 	LDI XL,$60
000371 9468               	SET
000372 e050               	LDI  SCNN,$00
000373 ed7f                	LDI  SCNDP,0B11011111
000374 e046               	LDI  CNT,$06
000375 ef67               	LDI  KSNI,0B11110111
000376 ef0f      	  COL1:	LDI  TEMP,$FF
000377 bb07               	OUT  DDRb,TEMP
000378 bb04               	OUT  DDRC,TEMP
000379 bb05      		OUT  PORTC,TEMP 
00037a bb01               	OUT  DDRd,TEMP
00037b bb72      		OUT  PORTd,SCNDP
00037c 901d               	LD   R1,X+
00037d ba18               	OUT  PORTb,R1
00037e d025               	RCALL  DELAY
00037f 2f04               	MOV  TEMP,CNT
000380 5003               	SUBI  TEMP,$03
000381 f0a0               	BRCS  NOSK
000382 e014               	LDI  TEMP1,$04
000383 e00f               	LDI  TEMP,0B00001111
000384 bb04               	OUT  DDRc,TEMP
000385 bb65      	        OUT  PORTc,KSNI
000386 d029               	RCALL  DELYT
000387 b303               	IN   TEMP,PINc
000388 7f00               	ANDI  TEMP,0B11110000
000389 9502               	SWAP  TEMP
00038a 9408                KROW: SEC 
00038b 9507              	ROR  TEMP
00038c f020               	BRCS  NOKEY
00038d 94e8               	CLT
00038e 2f85               	MOV   KEYN,SCNN
00038f 9b87      	 	SBIS PINd,$07
000390 9640      	 	ADIW KEYN,$10	
000391 9553               NOKEY: INC  SCNN
000392 951a                	DEC  TEMP1
000393 f7b1                	BRNE  KROW
000394 9408                	SEC
000395 9567                	ROR  KSNI
000396 9408           	  NOSK: SEC
000397 9577                	ROR  SCNDP
000398 954a                	DEC  CNT
000399 f6e1                	BRNE  COL1
00039a ef0f                	LDI   TEMP,$FF
00039b bb04                	OUT   DDRC,TEMP
00039c bb05      		OUT   PORTC,TEMP
00039d 910f      	 	POP TEMP
00039e 911f      	  	POP TEMP1
00039f 912f      		POP TEMP2
0003a0 913f      		POP TEMP3
0003a1 91af      	  	POP XL     
0003a2 91bf      		pop xh   
0003a3 9508      	  	RET
0003a4 931f            delay:	push temp1
0003a5 933f      		push temp3
0003a6 e110      		ldi temp1,$10
0003a7 e230          	   dt11:ldi temp3,$20
0003a8 0000                 dt21:nop
0003a9 953a      	 	dec temp3
0003aa f7e9      	 	brne dt21
0003ab 951a      	 	dec temp1
0003ac f7d1      		brne dt11
0003ad 913f      		pop temp3
0003ae 911f      		pop temp1
0003af 9508      	 	ret
0003b0 e230            delyt:	ldi temp3,$20		
0003b1 953a      	   dt31:dec temp3
0003b2 f7f1      	 	brne dt31
0003b3 9508      	 	ret
           .org $0400	
           .def hsb=r21				;逐次逼近式A/D转换
           .def msb=r18
           .def lsb=r17
           .def data=r16
           .def datah=r18
           .def datal=r17
000400 e100      		ldi temp,$10
000401 2e70      		mov r7,temp
000402 2e60      		mov r6,temp
000403 2e50      		mov r5,temp
000404 2e40      		mov r4,temp
000405 ef3f      		ldi temp3,$ff
000406 bb31      		out ddrd,temp3
000407 dd58      	  adag:	rcall disbyreg
000408 e6c3      		ldi yl,$63
000409 8188      		ld keyn,y
00040a e830      		ldi temp3,$80
00040b 0f83      		add keyn,temp3
00040c 8388      		st y,keyn		
00040d df5c      		rcall scan1
00040e df5b      		rcall scan1
00040f 2733      		clr temp3
000410 bb37      		out ddrb,temp3
000411 bb38      		out portb,temp3
000412 bb3a      		out ddra,temp3
000413 bb3b      		out porta,temp3
000414 df8f      		rcall delay
000415 2700      	  adc08:clr data		;A/D转换。
000416 e048      		ldi cnt,$08
000417 e810      		ldi temp1,$80
000418 2f21      	nextd:  mov temp2,temp1
000419 2b20      		or temp2,DATA
00041a bb22      		out portd,temp2
00041b df88      		rcall delay		
00041c 9945      		sbic acsr,aco
00041d 2f02      		mov data,temp2
00041e 9516      		lsr temp1
00041f 954a      		dec cnt
000420 f7b9      		brne nextd
000421 d004      		rcall dataconv
000422 2e45      		mov r4,hsb	;转换结果送显示。
000423 2e32      		mov r3,msb
000424 2e21      		mov r2,lsb
000425 cfe1      		rjmp adag	 	
          dataconv:			;把已经转换的16进制换算为双字节的确10进制数。			
000426 e71d              ldi     datal,125
000427 2722              clr     datah           ;c*p=hl
000428 e048              ldi     cnt,8
000429 9516              lsr     datal
00042a f408      m8u_1:  brcc    m8u_2
00042b 0f20              add     datah,data
00042c 9527      m8u_2:  ror     datah
00042d 9517              ror     datal
00042e 954a              dec     cnt
00042f f7d1              brne    m8u_1
         
000430 e046              ldi     cnt,6
000431 9488      d_64:   clc
000432 9527              ror     datah
000433 9517              ror     datal
000434 954a              dec     cnt
000435 f7d9              brne    d_64
         
000436 2755              clr     hsb
000437 5614      bcd8_1: subi    datal,100
000438 f010              brcs    bcd8_2
000439 9553              inc     hsb
00043a cffc              rjmp    bcd8_1
00043b 2322      bcd8_2: tst    datah
00043c f019              breq   bcd8_3
00043d 952a              dec    datah
00043e 9553              inc    hsb
00043f cff7              rjmp   bcd8_1
         
000440 591c      bcd8_3: subi   datal,-100
000441 501a      bcd8_4: subi   datal,10
000442 f010              brcs   bcd8_5
000443 9523              inc    msb
000444 cffc              rjmp   bcd8_4
000445 5f16      bcd8_5: subi   datal,-10
000446 9508              ret
           .ORG $0500
000500 2444      LCD:	clr r4
000501 2455      	clr r5
000502 2466      	clr r6
000503 2477      	clr r7
000504 27ff      	clr zh
000505 27bb      	clr xh
000506 27dd      	clr yh
000507 d0fb      	rcall indipramc  	;调用初始化显示内存。
000508 ef0f               ldi temp,$ff
000509 bb01                     out ddrd,temp
00050a bb02                     out portd,temp
00050b e000                     ldi temp,$00
00050c bb07                     out ddrb,temp
00050d bb08                     out portb,temp       
00050e e011      		ldi temp1,$01
00050f d335      		rcall contd
000510 d368      		RCALL DELAYY
000511 e318      		ldi temp1,$38
000512 d332      		rcall contd
000513 e016      		LDI TEMP1,$06
000514 d330      		rcall contd
000515 e01c      		LDI TEMP1,$0c
000516 d32e      		RCALL CONTD
000517 d315      		RCALL WR1RAM     
000518 d12f      		RCALL WR2RAM
000519 e007          	scanadc:ldi temp,$07
00051a e6c0      		ldi yl,$60
00051b d0f4      	 scannc:rcall scan1c
00051c f3f6      	 	brts scannc
00051d d0f2               scankc:rcall scan1c
00051e f7f6      	 	brtc scankc
00051f d0f0      	 	rcall scan1c
000520 9488        	 scansc: clc
000521 3180               	cpi keyn,$10
000522 f428      	 	brcc commkeyc         
000523 de18      	 	rcall wraddramc
000524 950a      		dec temp
000525 3003      		cpi temp,$03
000526 f7a1      		brne scannc
000527 cff1      		rjmp scanadc
000528 0000             commkeyc:nop
000529 3183      		cpi keyn,$13
00052a f409      		brne zadd
00052b cb04      		rjmp reset
00052c 3182      	zadd:	cpi keyn,$12
00052d f029      		breq srmemc
00052e 3181      		cpi keyn,$11 	
00052f f021      		breq epmemc
000530 3180      		cpi keyn,$10
000531 f019      		breq directtc
000532 cfe8      		rjmp scannc
000533 c067               srmemc: rjmp srmemtc
000534 c001               epmemc: rjmp epmemtc
000535 cc4f             directtc: rjmp direct
000536 dc59        epmemtc:       rcall meradd		;调用由R7-R4产生的地址入TEMP2TEMP1。
000537 3022      		cpi temp2,$02		;EEPROM必须小于0200H。
000538 f018      		brcs epdownc
000539 e021                      ldi temp2,$01
00053a ef1f                      ldi temp1,$ff
00053b dc5b                      rcall dviadd
00053c bb2f      	 epdownc:out eearh,temp2			
00053d bb1e      		out eearl,temp1
00053e 9ae0      		sbi eecr,$00
00053f b31d       		in temp1,eedr
000540 2e21      		mov r2,temp1
000541 2e81      		mov r8,temp1
000542 dc3a      		rcall dtor32		;数据放入R3R2中。
000543 dc2a      		rcall disbyregc		;改变显示内存。
000544 d0cb              epscannc:rcall scan1c		;键扫
000545 f3f6      	 	brts epscannc
000546 d0c9              epscankc:rcall scan1c
000547 f7f6      	 	brtc epscankc
000548 d0c7      	 	rcall scan1c
000549 3183        	epscansc:cpi keyn,$13
00054a f409      		brne epreturnc
00054b cae4      		rjmp reset				
00054c 3180             epreturnc:cpi keyn,$10
00054d f478      	 	brcc epcommkeyc         
00054e 2e38      		mov r3,keyn
00054f dc1e      		rcall disbyregc
000550 d0bf      	 escannc:rcall scan1c
000551 f3f6      	 	brts escannc
000552 d0bd               escankc:rcall scan1c
000553 f7f6      	 	brtc escankc
000554 d0bb      	 	rcall scan1c
000555 3183        	 escansc:cpi keyn,$13
000556 f409      		brne ereturnc
000557 cad8      		rjmp reset
000558 3180              ereturnc:cpi keyn,$10
000559 f458      	 	brcc ecommkeyc
00055a 2e28      		mov r2,keyn
00055b dc12      		rcall disbyregc
00055c cfe7      		rjmp epscannc   
00055d 3183            epcommkeyc:cpi keyn,$13
00055e f409      		brne epreturn1c
00055f cad0      		rjmp reset
000560 318e            epreturn1c:cpi keyn,$1e		
000561 f059      		breq eplastkeyc
000562 318f      		cpi keyn,$1f
000563 f101      		breq epnextkeyc
000564 cfdf      		rjmp epscannc
000565 3183             ecommkeyc:cpi keyn,$13
000566 f409      		brne ereturn1c
000567 cac8      		rjmp reset
000568 318e             ereturn1c:cpi keyn,$1e
000569 f019      		breq eplastkeyc
00056a 318f      		cpi keyn,$1f
00056b f0c1      		breq epnextkeyc
00056c cfe3      		rjmp escannc	
00056d dc22            eplastkeyc:rcall meradd
00056e 2d03      		mov temp,r3
00056f 9502      		swap temp
000570 2902      		or temp,r2
000571 1508      		cp temp,r8
000572 f039      		breq eplastc
000573 98e0      		cbi eecr,$00                
000574 bb2f      		out eearh,temp2
000575 bb1e      		out eearl,temp1
000576 9ae2      		sbi eecr,$02
000577 9ae1      		sbi eecr,$01
000578 99e1      	epwrwtc: sbic eecr,$01	
000579 cffe      		rjmp epwrwtc	
00057a 3010      	eplastc:cpi temp1,$00
00057b f419      		brne eplastkey1c
00057c 3020      		cpi temp2,$00
00057d f409      		brne eplastkey1c
00057e cfc5      		rjmp epscannc
00057f 9488           eplastkey1c:clc
000580 5011      		subi temp1,$01
000581 4020      		sbci temp2,$00
000582 dc14      		rcall dviadd
000583 cfb2      		rjmp epmemtc
000584 dc0b            epnextkeyc:rcall meradd
000585 2d03      		mov temp,r3
000586 9502      		swap temp
000587 2902      		or temp,r2
000588 1508      		cp temp,r8
000589 f039      		breq epnextc
00058a 98e0                      cbi eecr,$00
00058b bb2f      		out eearh,temp2
00058c bb1e      		out eearl,temp1

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -