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

📄 lcd.s

📁 已经上传的YF-320240-3.5寸彩屏(可由单片机控制)的测试程序。主CPU为MEGA128
💻 S
📖 第 1 页 / 共 5 页
字号:
	.dbline 179
;                   x += 16;
	movw R24,R6
	adiw R24,16
	movw R6,R24
	.dbline 180
;                   if(x>319)
	ldi R24,319
	ldi R25,1
	cp R24,R6
	cpc R25,R7
	brsh L61
	.dbline 181
;                   {
	.dbline 182
;                       y += 16;
	mov R24,R4
	subi R24,240    ; addi 16
	mov R4,R24
	.dbline 183
;                       x = 0;
	clr R6
	clr R7
	.dbline 184
;                   }
L61:
	.dbline 185
;              }
L43:
	.dbline 186
L40:
	.dbline 132
	cp R22,R20
	brsh X5
	xjmp L39
X5:
	.dbline -2
L35:
	adiw R28,6
	xcall pop_gset5
	.dbline 0 ; func end
	ret
	.dbsym r uLen 20 c
	.dbsym r i 22 c
	.dbsym r dat 10 i
	.dbsym r back 12 c
	.dbsym r front 14 c
	.dbsym l font 18 c
	.dbsym l ptr 16 pc
	.dbsym r y 4 c
	.dbsym r x 6 i
	.dbend
	.dbfunc e Dis_Asc_1624 _Dis_Asc_1624 fV
;              i -> R20
;           uLen -> R22
;            dat -> R14,R15
;              k -> R12
;              j -> R10
;           back -> R8
;          front -> R6
;            ptr -> y+14
;              y -> y+12
;              x -> y+10
	.even
_Dis_Asc_1624::
	xcall push_arg4
	xcall push_gset5
	ldd R6,y+16
	ldd R8,y+18
	.dbline -1
	.dbline 198
;         }
; }
; /* 日期:2005.12.1
;    编写者:赫树开
;    功能:显示一个16X24的ASCII字符串
;    参数: x 为起点x坐标
;            y  为起点y坐标
; 		   ptr 为字符串内容
; 		   front 是字符前景色
; 		   back  是字符串背景色  
; 		   */
; void Dis_Asc_1624(unsigned int x,unsigned char y,unsigned char *ptr,unsigned char front,unsigned char back)
; {
	.dbline 199
;         unsigned char uLen,i=0;
	clr R20
	.dbline 202
; 		unsigned char j,k;
;         unsigned int  dat;
;         uLen=0;
	clr R22
	xjmp L65
L64:
	.dbline 203
	.dbline 203
	inc R22
	.dbline 203
L65:
	.dbline 203
; 	    while ( (unsigned char)ptr[uLen] >= 0x10 ){uLen++;};	//探测字串长度
	mov R30,R22
	clr R31
	ldd R0,y+14
	ldd R1,y+15
	add R30,R0
	adc R31,R1
	ldd R24,z+0
	cpi R24,16
	brsh L64
	.dbline 203
	.dbline 205
; 	    //uLen = strlen(ptr);
; 		 CMD = LCD_MODE_1;
	ldi R24,2
	sts 32770,R24
	.dbline 206
; 		 DAT = front;
	sts 32771,R6
	.dbline 207
; 		 CMD = LCD_MODE_2;
	ldi R24,4
	sts 32770,R24
	.dbline 208
; 		 DAT = back;
	sts 32771,R8
	.dbline 209
; 		 CMD = LCD_MODE_0+LCD_DOT8;
	ldi R24,1
	sts 32770,R24
	xjmp L68
L67:
	.dbline 211
;         while(i<uLen)
;         {
	.dbline 212
; 				  dat = ptr[i] - 0x20;
	mov R30,R20
	clr R31
	ldd R0,y+14
	ldd R1,y+15
	add R30,R0
	adc R31,R1
	ldd R24,z+0
	clr R25
	sbiw R24,32
	movw R14,R24
	.dbline 213
;                   k = 0;  
	clr R12
	.dbline 214
;                  for(j=y;j<y+24;j++)
	ldd R10,y+12
	xjmp L73
L70:
	.dbline 215
	.dbline 216
	sts 32769,R10
	.dbline 217
	ldd R2,y+10
	ldd R3,y+11
	sts 32768,R2
	.dbline 218
	mov R2,R3
	clr R3
	sts 32768,R2
	.dbline 219
	mov R2,R12
	clr R3
	mov R24,R2
	subi R24,255    ; addi 1
	mov R12,R24
	ldi R16,48
	ldi R17,0
	movw R18,R14
	xcall empy16s
	movw R4,R16
	ldi R24,<_Cdot1624
	ldi R25,>_Cdot1624
	add R4,R24
	adc R5,R25
	mov R30,R2
	clr R31
	add R30,R4
	adc R31,R5
	elpm R30,Z
	sts 32771,R30
	.dbline 220
	mov R2,R12
	clr R3
	mov R24,R2
	subi R24,255    ; addi 1
	mov R12,R24
	ldi R16,48
	ldi R17,0
	movw R18,R14
	xcall empy16s
	movw R4,R16
	ldi R24,<_Cdot1624
	ldi R25,>_Cdot1624
	add R4,R24
	adc R5,R25
	mov R30,R2
	clr R31
	add R30,R4
	adc R31,R5
	elpm R30,Z
	sts 32771,R30
	.dbline 221
L71:
	.dbline 214
	inc R10
L73:
	.dbline 214
	ldd R24,y+12
	subi R24,232    ; addi 24
	cp R10,R24
	brsh X6
	xjmp L70
X6:
	.dbline 222
;                  {
;                     Y_ADDR = j;
;                     X_ADDR = x;
; 					X_ADDR = x/256;
; 					DAT = Cdot1624[dat][k++];
; 					DAT = Cdot1624[dat][k++];
;                  }
;                   x += 16;
	ldd R24,y+10
	ldd R25,y+11
	adiw R24,16
	std y+11,R25
	std y+10,R24
	.dbline 223
;                   if(x>319)
	ldi R24,319
	ldi R25,1
	ldd R0,y+10
	ldd R1,y+11
	cp R24,R0
	cpc R25,R1
	brsh L74
	.dbline 224
;                   {
	.dbline 225
;                       y += 24;
	ldd R24,y+12
	subi R24,232    ; addi 24
	std y+12,R24
	.dbline 226
;                       x = 0;
	clr R0
	clr R1
	std y+11,R1
	std y+10,R0
	.dbline 227
;                   }
L74:
	.dbline 228
	inc R20
	.dbline 229
L68:
	.dbline 210
	cp R20,R22
	brsh X7
	xjmp L67
X7:
	.dbline 230
; 				  i++; 
;         }
; 		CMD = LCD_MODE_0+LCD_DOT1;
	clr R2
	sts 32770,R2
	.dbline -2
L63:
	xcall pop_gset5
	adiw R28,4
	.dbline 0 ; func end
	ret
	.dbsym r i 20 c
	.dbsym r uLen 22 c
	.dbsym r dat 14 i
	.dbsym r k 12 c
	.dbsym r j 10 c
	.dbsym r back 8 c
	.dbsym r front 6 c
	.dbsym l ptr 14 pc
	.dbsym l y 12 c
	.dbsym l x 10 i
	.dbend
	.dbfunc e Dis_Menu _Dis_Menu fV
	.dbstruct 0 17 Command
	.dbfield 0 x i
	.dbfield 2 y c
	.dbfield 3 width i
	.dbfield 5 width_e i
	.dbfield 7 lenth c
	.dbfield 8 lenth_e c
	.dbfield 9 color c
	.dbfield 10 str pc
	.dbfield 12 english pc
	.dbfield 14 string_color c
	.dbfield 15 font c
	.dbfield 16 cursor_color c
	.dbend
;              i -> R20
;           size -> R22
;            cmd -> R10,R11
	.even
_Dis_Menu::
	xcall push_gset3
	mov R22,R18
	movw R10,R16
	sbiw R28,17
	.dbline -1
	.dbline 234
; }	
; 
; void Dis_Menu(struct Command const *cmd,unsigned char size)
; {    unsigned char i;
	.dbline 235
;      for(i = 0;i<size;i++)
	clr R20
	xjmp L80
L77:
	.dbline 236
	.dbline 237
	ldi R24,17
	mul R24,R20
	movw R2,R0
	add R2,R10
	adc R3,R11
	movw R24,R28
	ldi R16,17
	ldi R17,0
	st -y,R25
	st -y,R24
	st -y,R3
	st -y,R2
	xcall asgncblk
	movw R16,R28
	xcall _Dis_Command
	.dbline 238
L78:
	.dbline 235
	inc R20
L80:
	.dbline 235
	cp R20,R22
	brlo L77
	.dbline -2
L76:
	adiw R28,17
	xcall pop_gset3
	.dbline 0 ; func end
	ret
	.dbsym r i 20 c
	.dbsym r size 22 c
	.dbsym r cmd 10 pkS[Command]
	.dbend
	.area lit(rom, con, rel)
_ASC_MSK::
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,24
	.byte 60,60
	.byte 60,24
	.byte 24,0
	.byte 24,24
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,'f
	.byte 'f,'f
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,54
	.byte 54,127
	.byte 54,54
	.byte 54,127
	.byte 54,54
	.byte 0,0
	.byte 0,0
	.byte 0,24
	.byte 24,60
	.byte 'f,96
	.byte 48,24
	.byte 12,6
	.byte 'f,60
	.byte 24,24
	.byte 0,0
	.byte 0,0
	.byte 'p,216
	.byte 218,'v
	.byte 12,24
	.byte 48,'n
	.byte 91,27
	.byte 14,0
	.byte 0,0
	.byte 0,0
	.byte 0,56
	.byte 'l,'l
	.byte 56,96
	.byte 'o,'f
	.byte 'f,59
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,24
	.byte 24,24
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,12
	.byte 24,24
	.byte 48,48
	.byte 48,48
	.byte 48,24
	.byte 24,12
	.byte 0,0
	.byte 0,0
	.byte 0,48
	.byte 24,24
	.byte 12,12
	.byte 12,12
	.byte 12,24
	.byte 24,48
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,54
	.byte 28,127
	.byte 28,54
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,24
	.byte 24,126
	.byte 24,24
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 28,28
	.byte 12,24
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,126
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 28,28
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,6
	.byte 6,12
	.byte 12,24
	.byte 24,48
	.byte 48,96
	.byte 96,0
	.byte 0,0
	.byte 0,0
	.byte 0,30
	.byte 51,55
	.byte 55,51
	.byte 59,59
	.byte 51,30
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,12
	.byte 28,124
	.byte 12,12
	.byte 12,12
	.byte 12,12
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,60
	.byte 'f,'f
	.byte 6,12
	.byte 24,48
	.byte 96,126
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,60
	.byte 'f,'f
	.byte 6,28
	.byte 6,'f
	.byte 'f,60
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,48
	.byte 48,54
	.byte 54,54
	.byte 'f,127
	.byte 6,6
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,126
	.byte 96,96
	.byte 96,124
	.byte 6,6
	.byte 12,'x
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,28
	.byte 24,48
	.byte 124,'f
	.byte 'f,'f
	.byte 'f,60
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,126
	.byte 6,12
	.byte 12,24
	.byte 24,48
	.byte 48,48
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,60
	.byte 'f,'f
	.byte 'v,60
	.byte 'n,'f
	.byte 'f,60
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,60
	.byte 'f,'f
	.byte 'f,'f
	.byte 62,12
	.byte 24,56
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,28
	.byte 28,0
	.byte 0,0
	.byte 28,28
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,28
	.byte 28,0
	.byte 0,0
	.byte 28,28
	.byte 12,24
	.byte 0,0
	.byte 0,0
	.byte 0,6
	.byte 12,24
	.byte 48,96
	.byte 48,24
	.byte 12,6
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 126,0
	.byte 126,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,96
	.byte 48,24
	.byte 12,6
	.byte 12,24
	.byte 48,96
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,60
	.byte 'f,'f
	.byte 12,24
	.byte 24,0
	.byte 24,24
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,126
	.byte 195,195
	.byte 207,219
	.byte 219,207
	.byte 192,127
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,24
	.byte 60,'f
	.byte 'f,'f
	.byte 126,'f
	.byte 'f,'f
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,124
	.byte 'f,'f
	.byte 'f,124
	.byte 'f,'f
	.byte 'f,124
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,60
	.byte 'f,'f
	.byte 96,96
	.byte 96,'f
	.byte 'f,60
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,'x
	.byte 'l,'f
	.byte 'f,'f
	.byte 'f,'f
	.byte 'l,'x
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,126
	.byte 96,96
	.byte 96,124
	.byte 96,96
	.byte 96,126
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,126
	.byte 96,96
	.byte 96,124
	.byte 96,96
	.byte 96,96
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,60
	.byte 'f,'f
	.byte 96,96
	.byte 'n,'f
	.byte 'f,62
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,'f
	.byte 'f,'f
	.byte 'f,126
	.byte 'f,'f
	.byte 'f,'f
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,60
	.byte 24,24
	.byte 24,24
	.byte 24,24
	.byte 24,60
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,6
	.byte 6,6
	.byte 6,6
	.byte 6,'f
	.byte 'f,60
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,'f
	.byte 'f,'l
	.byte 'l,'x
	.byte 'l,'l
	.byte 'f,'f
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,96
	.byte 96,96
	.byte 96,96
	.byte 96,96
	.byte 96,126
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,'c
	.byte 'c,'w
	.byte 'k,'k
	.byte 'k,'c
	.byte 'c,'c
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,'c
	.byte 'c,'s
	.byte 123,'o
	.byte 'g,'c
	.byte 'c,'c
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,60
	.byte 'f,'f
	.byte 'f,'f
	.byte 'f,'f
	.byte 'f,60
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,124
	.byte 'f,'f
	.byte 'f,124
	.byte 96,96
	.byte 96,96
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,60
	.byte 'f,'f
	.byte 'f,'f
	.byte 'f,'f
	.byte 'f,60
	.byte 12,6
	.byte 0,0
	.byte 0,0
	.byte 0,124
	.byte 'f,'f
	.byte 'f,124
	.byte 'l,'f
	.byte 'f,'f
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,60
	.byte 'f,96
	.byte 48,24
	.byte 12,6
	.byte 'f,60
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,126
	.byte 24,24
	.byte 24,24
	.byte 24,24
	.byte 24,24
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,'f
	.byte 'f,'f
	.byte 'f,'f
	.byte 'f,'f
	.byte 'f,60
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,'f
	.byte 'f,'f
	.byte 'f,'f
	.byte 'f,'f
	.byte 60,24
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,'c
	.byte 'c,'c
	.byte 'k,'k
	.byte 'k,54
	.byte 54,54
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,'f
	.byte 'f,52
	.byte 24,24
	.byte 44,'f
	.byte 'f,'f
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,'f
	.byte 'f,'f
	.byte 'f,60
	.byte 24,24
	.byte 24,24
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,126
	.byte 6,6
	.byte 12,24
	.byte 48,96
	.byte 96,126
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,60
	.byte 48,48
	.byte 48,48
	.byte 48,48
	.byte 48,48
	.byte 48,48
	.byte 60,60
	.byte 0,0
	.byte 0,96
	.byte 96,48
	.byte 48,24
	.byte 24,12
	.byte 12,6
	.byte 6,0
	.byte 0,0
	.byte 0,0
	.byte 0,60
	.byte 12,12
	.byte 12,12
	.byte 12,12
	.byte 12,12
	.byte 12,12
	.byte 60,60
	.byte 0,24
	.byte 60,'f
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 255,255
	.byte 0,56
	.byte 24,12
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,60
	.byte 6,6
	.byte 62,'f
	.byte 'f,62
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,96
	.byte 96,124
	.byte 'f,'f
	.byte 'f,'f
	.byte 'f,124
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,60
	.byte 'f,96
	.byte 96,96
	.byte 'f,60
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,6
	.byte 6,62
	.byte 'f,'f

⌨️ 快捷键说明

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