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

📄 3310.s

📁 基于ATmega64的MP3程序
💻 S
📖 第 1 页 / 共 2 页
字号:
	ldi R24,<L3
	ldi R25,>L3
	std y+3,R25
	std y+2,R24
	ldi R24,14
	std y+0,R24
	ldi R18,3
	clr R16
	xcall _LCD_write_String
	.dbline 259
;  LCD_write_String(0,4,14,"              ",0);
	clr R2
	std y+4,R2
	ldi R24,<L3
	ldi R25,>L3
	std y+3,R25
	std y+2,R24
	ldi R24,14
	std y+0,R24
	ldi R18,4
	clr R16
	xcall _LCD_write_String
	.dbline 260
;  LCD_write_String(0,5,14,"              ",0);
	clr R2
	std y+4,R2
	ldi R24,<L3
	ldi R25,>L3
	std y+3,R25
	std y+2,R24
	ldi R24,14
	std y+0,R24
	ldi R18,5
	clr R16
	xcall _LCD_write_String
	.dbline 261
;  LCD_write_String(0,6,14,"              ",0);
	clr R2
	std y+4,R2
	ldi R24,<L3
	ldi R25,>L3
	std y+3,R25
	std y+2,R24
	ldi R24,14
	std y+0,R24
	ldi R18,6
	clr R16
	xcall _LCD_write_String
	.dbline -2
L2:
	adiw R28,5
	.dbline 0 ; func end
	ret
	.dbend
	.dbfunc e LCD_set_XY _LCD_set_XY fV
;              Y -> R22
;              X -> R20
	.even
_LCD_set_XY::
	xcall push_gset2
	mov R22,R18
	mov R20,R16
	.dbline -1
	.dbline 281
; /*
; uint16 i;
; LCD_write_byte(0x0c, 0);  // 设定显示模式,正常显示
; LCD_write_byte(0x80, 0);  
; for (i=0; i<504; i++)
;  {
;   LCD_write_byte(0x00, 1);
;  }
;  */
; }
; 
; //=======================================================================
; //LCD_set_XY: 设置LCD坐标函数
; //输入参数:X:0-83
; //Y:0-5
; 
; 
; void LCD_set_XY(uint8 X, uint8 Y)
; 
; {
	.dbline 282
; LCD_write_byte(0x40|Y, 0);   // row
	clr R18
	mov R16,R22
	ori R16,64
	xcall _LCD_write_byte
	.dbline 283
; LCD_write_byte(0x80|X, 0);   // cloumn
	clr R18
	mov R16,R20
	ori R16,128
	xcall _LCD_write_byte
	.dbline -2
L4:
	xcall pop_gset2
	.dbline 0 ; func end
	ret
	.dbsym r Y 22 c
	.dbsym r X 20 c
	.dbend
	.dbfunc e LCD_write_char _LCD_write_char fV
;           line -> R20
;              N -> R22
;              c -> R10
	.even
_LCD_write_char::
	xcall push_gset3
	mov R22,R18
	mov R10,R16
	.dbline -1
	.dbline 291
; }
; 
; //=======================================================================
; //LCD_write_char: 显示英文字符
; //输入参数:c:显示的字符;
; 
; void LCD_write_char(uint8 c,uint8 N)
; {
	.dbline 293
; uint8 line;
; c -= 32;
	mov R24,R10
	subi R24,32
	mov R10,R24
	.dbline 294
; for (line=0; line<6; line++)
	clr R20
	xjmp L9
L6:
	.dbline 295
;  {if(N)
	.dbline 295
	tst R22
	breq L10
	.dbline 296
;   LCD_write_byte(~font6x8[c][line], 1);
	ldi R18,1
	ldi R24,6
	mul R24,R10
	movw R2,R0
	ldi R24,<_font6x8
	ldi R25,>_font6x8
	add R2,R24
	adc R3,R25
	mov R30,R20
	clr R31
	add R30,R2
	adc R31,R3
	lpm R16,Z
	com R16
	xcall _LCD_write_byte
	xjmp L11
L10:
	.dbline 298
;   else
;   LCD_write_byte(font6x8[c][line], 1);
	ldi R18,1
	ldi R24,6
	mul R24,R10
	movw R2,R0
	ldi R24,<_font6x8
	ldi R25,>_font6x8
	add R2,R24
	adc R3,R25
	mov R30,R20
	clr R31
	add R30,R2
	adc R31,R3
	lpm R16,Z
	xcall _LCD_write_byte
L11:
	.dbline 299
L7:
	.dbline 294
	inc R20
L9:
	.dbline 294
	cpi R20,6
	brlo L6
	.dbline -2
L5:
	xcall pop_gset3
	.dbline 0 ; func end
	ret
	.dbsym r line 20 c
	.dbsym r N 22 c
	.dbsym r c 10 c
	.dbend
	.dbfunc e LCD_write_String _LCD_write_String fV
;              N -> R20
;              s -> R22,R23
;              l -> R10
;              Y -> R14
;              X -> R12
	.even
_LCD_write_String::
	xcall push_gset5
	mov R14,R18
	mov R12,R16
	ldd R10,y+10
	ldd R22,y+12
	ldd R23,y+13
	ldd R20,y+14
	.dbline -1
	.dbline 308
;  }
; }
; 
; //=======================================================================
; //LCD_write_char: 英文字符串显示函数
; //输入参数:*s:英文字符串指针;l:显示字符串的长度 ;X、Y: 显示字符串的位置
; 
; void LCD_write_String(uint8 X,uint8 Y,uint8 l,uint8 *s,uint8 N)
; 
; {
	.dbline 309
; LCD_set_XY(X,Y);
	mov R18,R14
	mov R16,R12
	xcall _LCD_set_XY
	xjmp L14
L13:
	.dbline 311
	.dbline 312
	mov R18,R20
	movw R30,R22
	ldd R16,z+0
	xcall _LCD_write_char
	.dbline 313
	subi R22,255  ; offset = 1
	sbci R23,255
	.dbline 314
L14:
	.dbline 310
; while (l--) 
	mov R2,R10
	clr R3
	mov R24,R2
	subi R24,1
	mov R10,R24
	tst R2
	brne L13
	.dbline -2
L12:
	xcall pop_gset5
	.dbline 0 ; func end
	ret
	.dbsym r N 20 c
	.dbsym r s 22 pc
	.dbsym r l 10 c
	.dbsym r Y 14 c
	.dbsym r X 12 c
	.dbend
	.dbfunc e LCD_write_byte _LCD_write_byte fV
;        command -> R18
;           data -> R16
	.even
_LCD_write_byte::
	.dbline -1
	.dbline 324
; {
; LCD_write_char(*s,N);
; s++;
; }
; }
; 
; 
; //=======================================================================
; //LCD_write_byte: 使用SPI接口写数据到LCD
; //输入参数:data:写入的数据;command :写数据/命令选择;
; 
; void LCD_write_byte(uint8 data, uint8 command)
; 
; {
	.dbline 326
; 
; LCD_port &= ~LCD_CS ;// 使能LCD
	cbi 0x1b,6
	.dbline 328
; 
; if (command == 1)
	cpi R18,1
	brne L17
	.dbline 330
; 
; LCD_port |= LCD_DC ;// 传送数据
	sbi 0x1b,7
	xjmp L18
L17:
	.dbline 334
; 
; else
; 
; LCD_port &= ~LCD_DC ;// 传送命令
	cbi 0x1b,7
L18:
	.dbline 336
; 
; SPDR = data;// 传送数据到SPI寄存器
	out 0xf,R16
L19:
	.dbline 339
	.dbline 340
L20:
	.dbline 338
; 
; while ((SPSR & 0x80) == 0)
	sbis 0xe,7
	rjmp L19
	.dbline 342
; {
;  }// 等待数据传送完毕
; 
; LCD_port |= LCD_CS ;// 关闭LCD
	sbi 0x1b,6
	.dbline -2
L16:
	.dbline 0 ; func end
	ret
	.dbsym r command 18 c
	.dbsym r data 16 c
	.dbend
	.dbfunc e LCD_write_tubiao _LCD_write_tubiao fV
;              n -> R20
;           line -> R22
;              Y -> R10
;              X -> R20
	.even
_LCD_write_tubiao::
	xcall push_gset3
	mov R10,R18
	mov R20,R16
	ldd R22,y+6
	.dbline -1
	.dbline 348
; 
; }
; 
; //=======================================================================
; void LCD_write_tubiao(uint8 X, uint8 Y, uint8 line)
; {
	.dbline 351
;  uint8 n;
; 
;  LCD_set_XY(X,Y);//设置初始位置
	mov R18,R10
	mov R16,R20
	xcall _LCD_set_XY
	.dbline 353
;  
;  for (n=0; n<6; n++)//画一个6*8的图标
	clr R20
	xjmp L26
L23:
	.dbline 354
	.dbline 355
	ldi R18,1
	ldi R24,6
	mul R24,R22
	movw R2,R0
	ldi R24,<_Hzk3
	ldi R25,>_Hzk3
	add R2,R24
	adc R3,R25
	mov R30,R20
	clr R31
	add R30,R2
	adc R31,R3
	lpm R16,Z
	xcall _LCD_write_byte
	.dbline 357
L24:
	.dbline 353
	inc R20
L26:
	.dbline 353
	cpi R20,6
	brlo L23
	.dbline -2
L22:
	xcall pop_gset3
	.dbline 0 ; func end
	ret
	.dbsym r n 20 c
	.dbsym r line 22 c
	.dbsym r Y 10 c
	.dbsym r X 20 c
	.dbend
	.dbfunc e JINGDU _JINGDU fV
;              i -> R20
	.even
_JINGDU::
	xcall push_gset1
	.dbline -1
	.dbline 486
;      {
; 	  LCD_write_byte(Hzk3[line][n],1);
; 	      
;      }
; }
; 
; //=======================================================================
; //LCD_write_chi: 在LCD上显示汉字
; 
; //输入参数:X、Y:显示汉字的起始X、Y坐标;
; //ch_with :汉字点阵的宽度
; //num:显示汉字的个数;
; //line:汉字点阵数组中的起始行数
; //row:汉字显示的行间距
; 
; /*
; void LCD_write_chi(unsigned char X, unsigned char Y, 
; unsigned char ch_with,unsigned char num,
; unsigned char line,unsigned char row)
; 
; {
; 
; unsigned char i,n;
; 
; LCD_set_XY(X,Y);//设置初始位置
; 
; for (i=0;i<num;)
; 
; {
; for (n=0; n<ch_with*2; n++)//写一个汉字
; 
; { 
; 
; if (n==ch_with)//写汉字的下半部分
; 
; {
; 
; if (i==0) LCD_set_XY(X,Y+1);
; 
; else
; 
; LCD_set_XY((X+(ch_with+row)*i),Y+1);
; 
; }
; 
; LCD_write_byte(Hzk[line+i][n],1);
; 
; }
; 
; i++;
; 
; LCD_set_XY((X+(ch_with+row)*i),Y);
; 
; }
; 
; }
; */
; //=======================================================================
; 
; //LCD_write_chi: 汉字移动
; 
; //输入参数:X、Y:显示汉字的起始X、Y坐标;
; //T:移动速度;
; 
; /*
; void LCD_move_chi(void)
; 
; {
; 
; 
; unsigned char i,n,j=0;
; 
; unsigned char buffer_h[84]={0};
; 
; unsigned char buffer_l[84]={0};
; 
; for (i=0; i<172; i++)
; 
; {
; if((i/12)>5)
;      {
;         buffer_h[83]=0x00;
;         buffer_l[83]=0x00; 
; 	 }
; else 
;      {
; buffer_h[83]=Hzk[i/12][j];
; buffer_l[83]=Hzk[i/12][j+12];
;      }
; 
; j++;
; 
; if (j==12) j=0;
; 
; for (n=0; n<83; n++)
; 
; { 
; 
; buffer_h[n]=buffer_h[n+1];
; 
; buffer_l[n]=buffer_l[n+1];
; 
; } 
; 
; LCD_set_XY(0,0);
; 
; for (n=0; n<83; n++)
; 
; { 
; 
; LCD_write_byte(buffer_h[n],1);
; 
; } 
; 
; LCD_set_XY(0,1); 
; 
; for (n=0; n<83; n++)
; 
; { 
; 
; LCD_write_byte(buffer_l[n],1);
; 
; } 
; 
; Delay_ms(250);
; 
; }
; }
; */
; 
; //=======================================================================
; void JINGDU(void)
; {       uint8 i;
	.dbline 487
;         LCD_set_XY(0,4);
	ldi R18,4
	clr R16
	xcall _LCD_set_XY
	.dbline 488
; 		LCD_write_byte(0x7f,1);
	ldi R18,1
	ldi R16,127
	xcall _LCD_write_byte
	.dbline 489
;         i=82;
	ldi R20,82
	xjmp L29
L28:
	.dbline 491
	.dbline 492
	ldi R18,1
	ldi R16,65
	xcall _LCD_write_byte
	.dbline 493
L29:
	.dbline 490
;         while(i--)
	mov R2,R20
	clr R3
	subi R20,1
	tst R2
	brne L28
	.dbline 494
;         {
; 		 LCD_write_byte(0x41,1);
;         }
; 		LCD_write_byte(0x7f,1);
	ldi R18,1
	ldi R16,127
	xcall _LCD_write_byte
	.dbline -2
L27:
	xcall pop_gset1
	.dbline 0 ; func end
	ret
	.dbsym r i 20 c
	.dbend
	.dbfunc e GEPAI _GEPAI fV
;              i -> R20
	.even
_GEPAI::
	xcall push_gset1
	.dbline -1
	.dbline 499
; }
; 
; //=======================================================================
; void GEPAI(void)
; {
	.dbline 501
;  uint8 i;
;  LCD_set_XY(6,2);
	ldi R18,2
	ldi R16,6
	xcall _LCD_set_XY
	.dbline 502
;  for(i=0;i<72;i++)
	clr R20
	xjmp L35
L32:
	.dbline 503
	.dbline 504
	ldi R18,1
	clr R16
	xcall _LCD_write_byte
	.dbline 505
L33:
	.dbline 502
	inc R20
L35:
	.dbline 502
	cpi R20,72
	brlo L32
	.dbline 506
;     {
; 	 LCD_write_byte(0x00,1);
; 	}
;   LCD_set_XY(6,3);
	ldi R18,3
	ldi R16,6
	xcall _LCD_set_XY
	.dbline 507
;  for(i=0;i<72;i++)
	clr R20
	xjmp L39
L36:
	.dbline 508
	.dbline 509
	ldi R18,1
	clr R16
	xcall _LCD_write_byte
	.dbline 510
L37:
	.dbline 507
	inc R20
L39:
	.dbline 507
	cpi R20,72
	brlo L36
	.dbline -2
L31:
	xcall pop_gset1
	.dbline 0 ; func end
	ret
	.dbsym r i 20 c
	.dbend
	.area data(ram, con, rel)
	.dbfile D:\TDDownload\MP3BOA~1.8\3310.c
L3:
	.blkb 15
	.area idata
	.byte 32,32,32,32,32,32,32,32,32,32,32,32,32,32,0
	.area data(ram, con, rel)
	.dbfile D:\TDDownload\MP3BOA~1.8\3310.c

⌨️ 快捷键说明

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