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

📄 main.s

📁 已经上传的YF-320240-3.5寸彩屏(可由单片机控制)的测试程序。主CPU为MEGA128
💻 S
📖 第 1 页 / 共 4 页
字号:
;     				 REG_A = 0x20;
	ldi R24,32
	sts 45066,R24
	.dbline 578
; 					 REG_B = 0x12;
	ldi R24,18
	sts 45067,R24
	.dbline 580
; 					  
; 					     Display(150,150,"时间已保存!",SMALL,RED,0x97);
	ldi R24,151
	std y+6,R24
	ldi R24,224
	std y+4,R24
	clr R2
	std y+2,R2
	ldi R24,<L203
	ldi R25,>L203
	std y+1,R25
	std y+0,R24
	ldi R18,150
	ldi R16,150
	ldi R17,0
	xcall _Display
	.dbline 581
; 						 Delayx10ms(50);
	ldi R16,50
	ldi R17,0
	xcall _Delayx10ms
	.dbline 582
; 						 Display(150,150,"            ",SMALL,RED,0x97);
	ldi R24,151
	std y+6,R24
	ldi R24,224
	std y+4,R24
	clr R2
	std y+2,R2
	ldi R24,<L204
	ldi R25,>L204
	std y+1,R25
	std y+0,R24
	ldi R18,150
	ldi R16,150
	ldi R17,0
	xcall _Display
	.dbline 585
; 					
; 					 
; 				 }
	xjmp L182
L181:
	.dbline 586
; 				 else if(GetCursor(TimeSet[7]))
	ldi R24,<_TimeSet+119
	ldi R25,>_TimeSet+119
	movw R30,R28
	subi R30,62  ; offset = 194
	sbci R31,255
	ldi R16,17
	ldi R17,0
	st -y,R31
	st -y,R30
	st -y,R25
	st -y,R24
	xcall asgncblk
	movw R16,R28
	subi R16,62  ; offset = 194
	sbci R17,255
	xcall _GetCursor
	tst R16
	breq L205
	.dbline 587
; 				 {
	.dbline 588
; 				     cursor.x = 0;
	clr R2
	clr R3
	sts _cursor+1,R3
	sts _cursor,R2
	.dbline 589
; 					 cursor.y = 0;
	sts _cursor+2,R2
	.dbline 590
; 					 Main_Display();
	xcall _Main_Display
	.dbline 591
; 					 break;
	xjmp L104
L205:
L182:
L172:
L162:
L152:
L142:
L132:
L118:
	.dbline 593
; 				 }
; 			  }
L114:
	.dbline 594
L112:
	.dbline 474
	xjmp L111
X1:
	.dbline 595
; 			}
; 		}
	xjmp L104
L103:
	.dbline 596
; 		else if(GetCursor(Start[5]))//颜色测试
	ldi R24,<_Start+85
	ldi R25,>_Start+85
	movw R30,R28
	subi R30,181  ; offset = 75
	sbci R31,255
	ldi R16,17
	ldi R17,0
	st -y,R31
	st -y,R30
	st -y,R25
	st -y,R24
	xcall asgncblk
	movw R16,R28
	subi R16,181  ; offset = 75
	sbci R17,255
	xcall _GetCursor
	tst R16
	brne X9
	xjmp L209
X9:
	.dbline 597
; 		{
	.dbline 598
; 		     cursor.x = 0;
	clr R2
	clr R3
	sts _cursor+1,R3
	sts _cursor,R2
	.dbline 599
; 		     cursor.y = 0;
	sts _cursor+2,R2
	.dbline 600
; 			 cursor.flag = 0;
	sts _cursor+6,R2
	.dbline 601
; 			 count = 0;
	sts _count,R2
	.dbline 602
; 			 Clear_Display(Color_Set[count]);
	ldi R24,<_Color_Set
	ldi R25,>_Color_Set
	mov R30,R2
	clr R31
	add R30,R24
	adc R31,R25
	elpm R16,Z
	xcall _Clear_Display
	xjmp L215
L214:
	.dbline 604
; 			 while(1)
; 			 {
	.dbline 605
; 			     if(cursor.flag)
	lds R2,_cursor+6
	tst R2
	brne X10
	xjmp L217
X10:
	.dbline 606
; 				 {
	.dbline 607
; 				     if(GetCursor(Color[0]))//返回
	ldi R24,<_Color
	ldi R25,>_Color
	movw R30,R28
	subi R30,164  ; offset = 92
	sbci R31,255
	ldi R16,17
	ldi R17,0
	st -y,R31
	st -y,R30
	st -y,R25
	st -y,R24
	xcall asgncblk
	movw R16,R28
	subi R16,164  ; offset = 92
	sbci R17,255
	xcall _GetCursor
	tst R16
	breq L220
	.dbline 608
; 					 {
	.dbline 609
; 					     cursor.x = 0;
	clr R2
	clr R3
	sts _cursor+1,R3
	sts _cursor,R2
	.dbline 610
; 					 	 cursor.y = 0;
	sts _cursor+2,R2
	.dbline 611
; 					 	 Main_Display();
	xcall _Main_Display
	.dbline 612
; 					 	 break;
	xjmp L210
L220:
	.dbline 614
; 					 }
; 					 else if(GetCursor(Color[1]))
	ldi R24,<_Color+17
	ldi R25,>_Color+17
	movw R30,R28
	subi R30,147  ; offset = 109
	sbci R31,255
	ldi R16,17
	ldi R17,0
	st -y,R31
	st -y,R30
	st -y,R25
	st -y,R24
	xcall asgncblk
	movw R16,R28
	subi R16,147  ; offset = 109
	sbci R17,255
	xcall _GetCursor
	tst R16
	breq L223
	.dbline 615
; 					 {
	.dbline 616
; 					     count ++;
	lds R24,_count
	subi R24,255    ; addi 1
	sts _count,R24
	.dbline 617
; 						 if(count > 7) count = 0;
	ldi R24,7
	lds R2,_count
	cp R24,R2
	brsh L226
	.dbline 617
	clr R2
	sts _count,R2
L226:
	.dbline 618
; 					     Clear_Display(Color_Set[count]); 
	ldi R24,<_Color_Set
	ldi R25,>_Color_Set
	lds R30,_count
	clr R31
	add R30,R24
	adc R31,R25
	elpm R16,Z
	xcall _Clear_Display
	.dbline 619
; 					 }
L223:
	.dbline 620
; 				 }
L217:
	.dbline 621
L215:
	.dbline 603
	xjmp L214
X2:
	.dbline 622
; 			 }
; 		}
	xjmp L210
L209:
	.dbline 623
; 		else if(GetCursor(Start[6]))
	ldi R24,<_Start+102
	ldi R25,>_Start+102
	movw R30,R28
	subi R30,164  ; offset = 92
	sbci R31,255
	ldi R16,17
	ldi R17,0
	st -y,R31
	st -y,R30
	st -y,R25
	st -y,R24
	xcall asgncblk
	movw R16,R28
	subi R16,164  ; offset = 92
	sbci R17,255
	xcall _GetCursor
	tst R16
	brne X11
	xjmp L228
X11:
	.dbline 624
; 		{
	.dbline 625
; 		     Dis_Menu(Backlight,Backlight_size);
	ldi R18,4
	ldi R16,<_Backlight
	ldi R17,>_Backlight
	xcall _Dis_Menu
	.dbline 626
; 			 Dis_Int(160,100,Back_Val,0,BLACK,WHITE);
	ldi R24,255
	std y+6,R24
	clr R2
	std y+4,R2
	std y+2,R2
	std y+1,R23
	std y+0,R22
	ldi R18,100
	ldi R16,160
	ldi R17,0
	xcall _Dis_Int
	.dbline 627
; 			 ChangeLight(Back_Val);
	movw R16,R22
	xcall _ChangeLight
	xjmp L232
L231:
	.dbline 629
; 			 while(1)
; 			 {
	.dbline 630
; 			     if(cursor.flag)
	lds R2,_cursor+6
	tst R2
	brne X12
	xjmp L234
X12:
	.dbline 631
; 				 {
	.dbline 632
; 				    cursor.flag = 0;
	clr R2
	sts _cursor+6,R2
	.dbline 633
; 					if(BackLight == 1)
	cpi R20,1
	brne L238
	.dbline 634
; 					{
	.dbline 635
; 					    BackLight = 0;
	clr R20
	.dbline 636
; 						PowerOn();
	xcall _PowerOn
	.dbline 637
; 					}
	xjmp L239
L238:
	.dbline 638
; 				    else if(GetCursor(Backlight[0]))//增加
	ldi R24,<_Backlight
	ldi R25,>_Backlight
	movw R30,R28
	subi R30,147  ; offset = 109
	sbci R31,255
	ldi R16,17
	ldi R17,0
	st -y,R31
	st -y,R30
	st -y,R25
	st -y,R24
	xcall asgncblk
	movw R16,R28
	subi R16,147  ; offset = 109
	sbci R17,255
	xcall _GetCursor
	tst R16
	breq L240
	.dbline 639
; 					 {
	.dbline 640
; 					     Back_Val++;
	subi R22,255  ; offset = 1
	sbci R23,255
	.dbline 641
; 						 if(Back_Val > 7) Back_Val = 7;
	ldi R24,7
	ldi R25,0
	cp R24,R22
	cpc R25,R23
	brsh L242
	.dbline 641
	ldi R22,7
	ldi R23,0
L242:
	.dbline 642
; 						 Dis_Int(160,100,Back_Val,0,BLACK,WHITE);
	ldi R24,255
	std y+6,R24
	clr R2
	std y+4,R2
	std y+2,R2
	std y+1,R23
	std y+0,R22
	ldi R18,100
	ldi R16,160
	ldi R17,0
	xcall _Dis_Int
	.dbline 643
; 						 ChangeLight(Back_Val);
	movw R16,R22
	xcall _ChangeLight
	.dbline 645
; 		
; 					 }
	xjmp L241
L240:
	.dbline 646
; 					 else if(GetCursor(Backlight[1]))//减少
	ldi R24,<_Backlight+17
	ldi R25,>_Backlight+17
	movw R30,R28
	subi R30,130  ; offset = 126
	sbci R31,255
	ldi R16,17
	ldi R17,0
	st -y,R31
	st -y,R30
	st -y,R25
	st -y,R24
	xcall asgncblk
	movw R16,R28
	subi R16,130  ; offset = 126
	sbci R17,255
	xcall _GetCursor
	tst R16
	breq L244
	.dbline 647
; 					 {
	.dbline 648
; 					     Back_Val--;
	subi R22,1
	sbci R23,0
	.dbline 649
; 						 if(Back_Val > 7) Back_Val = 0;
	ldi R24,7
	ldi R25,0
	cp R24,R22
	cpc R25,R23
	brsh L247
	.dbline 649
	clr R22
	clr R23
L247:
	.dbline 650
; 						 Dis_Int(160,100,Back_Val,0,BLACK,WHITE);
	ldi R24,255
	std y+6,R24
	clr R2
	std y+4,R2
	std y+2,R2
	std y+1,R23
	std y+0,R22
	ldi R18,100
	ldi R16,160
	ldi R17,0
	xcall _Dis_Int
	.dbline 651
; 						 ChangeLight(Back_Val);
	movw R16,R22
	xcall _ChangeLight
	.dbline 652
; 					 }
	xjmp L245
L244:
	.dbline 653
; 					 else if(GetCursor(Backlight[2]))//关闭
	ldi R24,<_Backlight+34
	ldi R25,>_Backlight+34
	movw R30,R28
	subi R30,113  ; offset = 143
	sbci R31,255
	ldi R16,17
	ldi R17,0
	st -y,R31
	st -y,R30
	st -y,R25
	st -y,R24
	xcall asgncblk
	movw R16,R28
	subi R16,113  ; offset = 143
	sbci R17,255
	xcall _GetCursor
	tst R16
	breq L249
	.dbline 654
; 					 {
	.dbline 655
; 					     BackLight = 1;
	ldi R20,1
	.dbline 656
; 						 PowerOff();
	xcall _PowerOff
	.dbline 657
; 					 }
	xjmp L250
L249:
	.dbline 658
; 					 else if(GetCursor(Backlight[3]))//返回
	ldi R24,<_Backlight+51
	ldi R25,>_Backlight+51
	movw R30,R28
	subi R30,96  ; offset = 160
	sbci R31,255
	ldi R16,17
	ldi R17,0
	st -y,R31
	st -y,R30
	st -y,R25
	st -y,R24
	xcall asgncblk
	movw R16,R28
	subi R16,96  ; offset = 160
	sbci R17,255
	xcall _GetCursor
	tst R16
	breq L252
	.dbline 659
; 					 {
	.dbline 660
; 					     break;
	xjmp L233
L252:
L250:
L245:
L241:
L239:
	.dbline 664
; 					 }
; 					 
; 					
; 				 }
L234:
	.dbline 665
L232:
	.dbline 628
	xjmp L231
L233:
	.dbline 666
; 			 }
; 		}
L228:
L210:
L104:
L102:
L99:
L92:
	.dbline 667
; 			cursor.flag = 0;
	clr R2
	sts _cursor+6,R2
	.dbline 669
; 			
; 		}
L87:
	.dbline 671
; 		
; 		if(Time_flag == 1)
	lds R24,_Time_flag
	cpi R24,1
	brne L256
	.dbline 672
; 		{
	.dbline 673
; 		    DisTimeAll(100,165,BLACK,BLUE);
	ldi R24,3
	std y+2,R24
	clr R2
	std y+0,R2
	ldi R18,165
	ldi R16,100
	ldi R17,0
	xcall _DisTimeAll
	.dbline 674
; 		}
L256:
	.dbline 675
	ldi R24,255
	std y+2,R24
	ldi R24,224
	std y+0,R24
	ldi R18,220
	ldi R16,220
	ldi R17,0
	xcall _DisTime
	.dbline 677
L85:
	.dbline 430
	xjmp L84
X3:
	.dbline -2
L83:
	adiw R28,63
	adiw R28,63
	adiw R28,63
	adiw R28,22  ; offset = 211
	.dbline 0 ; func end
	ret
	.dbsym l list_time 8 i
	.dbsym r BackLight 20 c
	.dbsym r Back_Val 22 i
	.dbsym r i 10 i
	.dbend
	.area bss(ram, con, rel)
	.dbfile F:\Relations\sf6_system\measure\LCDtest\main.c
_Color_Count::
	.blkb 1
	.dbsym e Color_Count _Color_Count c
_time_temp::
	.blkb 15
	.dbsym e time_temp _time_temp A[15:15]c
	.area data(ram, con, rel)
	.dbfile F:\Relations\sf6_system\measure\LCDtest\main.c
L204:
	.blkb 13
	.area idata
	.byte 32,32,32,32,32,32,32,32,32,32,32,32,0
	.area data(ram, con, rel)
	.dbfile F:\Relations\sf6_system\measure\LCDtest\main.c
L203:
	.blkb 13
	.area idata
	.byte 202,177,188,228,210,209,177,163,180,230,163,161,0
	.area data(ram, con, rel)
	.dbfile F:\Relations\sf6_system\measure\LCDtest\main.c
L79:
	.blkb 3
	.area idata
	.byte 'Y,61,0
	.area data(ram, con, rel)
	.dbfile F:\Relations\sf6_system\measure\LCDtest\main.c
L78:
	.blkb 3
	.area idata
	.byte 'X,61,0
	.area data(ram, con, rel)
	.dbfile F:\Relations\sf6_system\measure\LCDtest\main.c
L27:
	.blkb 25
	.area idata
	.byte 32,32,32,32,32,32,202,177,32,32,32,32,32,32,183,214
	.byte 32,32,32,32,32,32,195,235,0
	.area data(ram, con, rel)
	.dbfile F:\Relations\sf6_system\measure\LCDtest\main.c
L26:
	.blkb 25
	.area idata
	.byte 32,32,32,32,32,32,196,234,32,32,32,32,32,32,212,194
	.byte 32,32,32,32,32,32,200,213,0
	.area data(ram, con, rel)
	.dbfile F:\Relations\sf6_system\measure\LCDtest\main.c
L15:
	.blkb 5
	.area idata
	.byte 'B,'A,'C,'K,0
	.area data(ram, con, rel)
	.dbfile F:\Relations\sf6_system\measure\LCDtest\main.c
L14:
	.blkb 3
	.area idata
	.byte 'O,'K,0
	.area data(ram, con, rel)
	.dbfile F:\Relations\sf6_system\measure\LCDtest\main.c
L13:
	.blkb 5
	.area idata
	.byte 200,183,200,207,0
	.area data(ram, con, rel)
	.dbfile F:\Relations\sf6_system\measure\LCDtest\main.c
L12:
	.blkb 5
	.area idata
	.byte 32,32,32,32,0
	.area data(ram, con, rel)
	.dbfile F:\Relations\sf6_system\measure\LCDtest\main.c
L11:
	.blkb 9
	.area idata
	.byte 177,179,185,226,178,226,202,212,0
	.area data(ram, con, rel)
	.dbfile F:\Relations\sf6_system\measure\LCDtest\main.c
L10:
	.blkb 9
	.area idata
	.byte 209,213,201,171,178,226,202,212,0
	.area data(ram, con, rel)
	.dbfile F:\Relations\sf6_system\measure\LCDtest\main.c
L9:
	.blkb 9
	.area idata
	.byte 202,177,188,228,201,232,182,168,0
	.area data(ram, con, rel)
	.dbfile F:\Relations\sf6_system\measure\LCDtest\main.c
L8:
	.blkb 5
	.area idata
	.byte 'S,'T,'O,'P,0
	.area data(ram, con, rel)
	.dbfile F:\Relations\sf6_system\measure\LCDtest\main.c
L7:
	.blkb 5
	.area idata
	.byte 'A,'U,'T,'O,0
	.area data(ram, con, rel)
	.dbfile F:\Relations\sf6_system\measure\LCDtest\main.c
L6:
	.blkb 5
	.area idata
	.byte 'G,'o,'O,'n,0
	.area data(ram, con, rel)
	.dbfile F:\Relations\sf6_system\measure\LCDtest\main.c
L5:
	.blkb 5
	.area idata
	.byte 183,181,187,216,0
	.area data(ram, con, rel)
	.dbfile F:\Relations\sf6_system\measure\LCDtest\main.c
L4:
	.blkb 5
	.area idata
	.byte 185,216,177,213,0
	.area data(ram, con, rel)
	.dbfile F:\Relations\sf6_system\measure\LCDtest\main.c
L3:
	.blkb 5
	.area idata
	.byte 188,245,201,217,0
	.area data(ram, con, rel)
	.dbfile F:\Relations\sf6_system\measure\LCDtest\main.c
L2:
	.blkb 5
	.area idata
	.byte 212,246,188,211,0
	.area data(ram, con, rel)
	.dbfile F:\Relations\sf6_system\measure\LCDtest\main.c
L1:
	.blkb 1
	.area idata
	.byte 0
	.area data(ram, con, rel)
	.dbfile F:\Relations\sf6_system\measure\LCDtest\main.c

⌨️ 快捷键说明

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