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

📄 main.s

📁 一个有关st7920控制器的测试程序和驱动程序的12864LCD的例程
💻 S
字号:
	.module main.c
	.area lit(rom, con, rel)
L2:
	.byte 210,186,190,167,178,226,202,212,181,218,210,187,208,208,43,43
	.byte 0
L3:
	.byte 210,186,190,167,178,226,202,212,181,218,182,254,208,208,43,43
	.byte 0
L4:
	.byte 210,186,190,167,178,226,202,212,181,218,200,253,208,208,43,43
	.byte 0
L5:
	.byte 210,186,190,167,178,226,202,212,181,218,203,196,208,208,43,43
	.byte 0
	.area text(rom, con, rel)
	.dbfile F:\avr开发板\EasyAVR使用说明\ST7920\source\main.c
	.dbfunc e main _main fV
;              i -> R20
;          disp4 -> y+51
;          disp3 -> y+34
;          disp2 -> y+17
;          disp1 -> y+0
	.even
_main::
	sbiw R28,63
	sbiw R28,5  ; offset = 68
	.dbline -1
	.dbline 8
; //ICC-AVR application builder : 2008-3-13 20:12:51
; // Target : M128
; // Crystal: 7.3728Mhz
; 
; #include "config.h"
; 
; void main(void)
; {
	.dbline 9
;  unsigned char disp1[]="液晶测试第一行++";
	ldi R24,<L2
	ldi R25,>L2
	movw R30,R28
	ldi R16,17
	ldi R17,0
	st -y,R31
	st -y,R30
	st -y,R25
	st -y,R24
	xcall asgncblk
	.dbline 10
;  unsigned char disp2[]="液晶测试第二行++";
	ldi R24,<L3
	ldi R25,>L3
	movw R30,R28
	adiw R30,17
	ldi R16,17
	ldi R17,0
	st -y,R31
	st -y,R30
	st -y,R25
	st -y,R24
	xcall asgncblk
	.dbline 11
;  unsigned char disp3[]="液晶测试第三行++";
	ldi R24,<L4
	ldi R25,>L4
	movw R30,R28
	adiw R30,34
	ldi R16,17
	ldi R17,0
	st -y,R31
	st -y,R30
	st -y,R25
	st -y,R24
	xcall asgncblk
	.dbline 12
;  unsigned char disp4[]="液晶测试第四行++";
	ldi R24,<L5
	ldi R25,>L5
	movw R30,R28
	adiw R30,51
	ldi R16,17
	ldi R17,0
	st -y,R31
	st -y,R30
	st -y,R25
	st -y,R24
	xcall asgncblk
	.dbline 13
;  unsigned char i=0;
	clr R20
	.dbline 15
;  
;  PORTA = 0xFF;
	ldi R24,255
	out 0x1b,R24
	.dbline 16
;  DDRA = 0x00;
	clr R2
	out 0x1a,R2
	.dbline 17
;  PORTC = 0x00;
	out 0x15,R2
	.dbline 18
;  DDRC = 0xFF;
	out 0x14,R24
	.dbline 20
;  //PORTC |= (1<<6)|(1<<5)|(1<<0);
;  PORTC |= (1<<5)|(1<<0);
	in R24,0x15
	ori R24,33
	out 0x15,R24
	.dbline 22
;  
;  initial_lcd();
	xcall _initial_lcd
	.dbline 23
;  Lcd_clrbmp();
	xcall _Lcd_clrbmp
	.dbline 24
;  Lcd_clrbmp();
	xcall _Lcd_clrbmp
	.dbline 26
; 
;   Lcd_linedisp(disp1,1);
	ldi R18,1
	movw R16,R28
	xcall _Lcd_linedisp
	.dbline 27
;   Lcd_linedisp(disp2,2); 
	ldi R18,2
	movw R16,R28
	subi R16,239  ; offset = 17
	sbci R17,255
	xcall _Lcd_linedisp
	.dbline 28
;   Lcd_linedisp(disp3,3); 
	ldi R18,3
	movw R16,R28
	subi R16,222  ; offset = 34
	sbci R17,255
	xcall _Lcd_linedisp
	.dbline 29
;   Lcd_linedisp(disp4,4);
	ldi R18,4
	movw R16,R28
	subi R16,205  ; offset = 51
	sbci R17,255
	xcall _Lcd_linedisp
L6:
	.dbline 31
	.dbline 33
L7:
	.dbline 30
	xjmp L6
X0:
	.dbline -2
L1:
	adiw R28,63
	adiw R28,5  ; offset = 68
	.dbline 0 ; func end
	ret
	.dbsym r i 20 c
	.dbsym l disp4 51 A[17:17]c
	.dbsym l disp3 34 A[17:17]c
	.dbsym l disp2 17 A[17:17]c
	.dbsym l disp1 0 A[17:17]c
	.dbend

⌨️ 快捷键说明

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