📄 12864_lcd_test.s
字号:
.module _12864_LCD_TEST.c
.area text(rom, con, rel)
.dbfile D:\M16开发板实验教程\icc-avr\12864\12864_LCD_TEST.c
.dbfunc e main _main fV
.even
_main::
sbiw R28,2
.dbline -1
.dbline 14
; #include "iom16v.h"
; #include "macros.h"
; #include "12864.h"
;
; // 配置熔丝参数 @8MHz
;
; extern void delay_nus(unsigned int n);
; extern void delay_nms(unsigned int n);
;
; char *str1,*str2,*str3,*str4,*str5,*str6,*str7,*str8;
;
; void portinitial(void);
; void main(void)
; {
.dbline 16
;
; str1="AVR Mega16 BOARD";
ldi R24,<L2
ldi R25,>L2
sts _str1+1,R25
sts _str1,R24
.dbline 17
; str2=" 学习开发板 ";
ldi R24,<L3
ldi R25,>L3
sts _str2+1,R25
sts _str2,R24
.dbline 18
; str3=" dushibiao ";
ldi R24,<L4
ldi R25,>L4
sts _str3+1,R25
sts _str3,R24
.dbline 19
; str4="2007年11月制作";
ldi R24,<L5
ldi R25,>L5
sts _str4+1,R25
sts _str4,R24
.dbline 20
; str6="12864 液晶试验";
ldi R24,<L6
ldi R25,>L6
sts _str6+1,R25
sts _str6,R24
.dbline 21
; str7="并行总线接法练习";
ldi R24,<L7
ldi R25,>L7
sts _str7+1,R25
sts _str7,R24
.dbline 22
; portinitial();
xcall _portinitial
.dbline 23
; delay_nms(10);
ldi R16,10
ldi R17,0
xcall _delay_nms
.dbline 24
; LCD_init();
xcall _LCD_init
xjmp L9
L8:
.dbline 25
.dbline 26
clr R18
clr R19
ldi R16,1
ldi R17,0
xcall _LCD_write_char
.dbline 27
lds R2,_str1
lds R3,_str1+1
std y+1,R3
std y+0,R2
clr R18
ldi R16,2
xcall _LCD_write_string
.dbline 28
lds R2,_str2
lds R3,_str2+1
std y+1,R3
std y+0,R2
ldi R18,1
clr R16
xcall _LCD_write_string
.dbline 29
lds R2,_str3
lds R3,_str3+1
std y+1,R3
std y+0,R2
ldi R18,2
clr R16
xcall _LCD_write_string
.dbline 30
lds R2,_str4
lds R3,_str4+1
std y+1,R3
std y+0,R2
ldi R18,3
clr R16
xcall _LCD_write_string
.dbline 31
ldi R16,4000
ldi R17,15
xcall _delay_nms
.dbline 32
clr R18
clr R19
ldi R16,1
ldi R17,0
xcall _LCD_write_char
.dbline 33
lds R2,_str5
lds R3,_str5+1
std y+1,R3
std y+0,R2
clr R18
ldi R16,2
xcall _LCD_write_string
.dbline 34
lds R2,_str6
lds R3,_str6+1
std y+1,R3
std y+0,R2
ldi R18,1
clr R16
xcall _LCD_write_string
.dbline 35
lds R2,_str7
lds R3,_str7+1
std y+1,R3
std y+0,R2
ldi R18,2
clr R16
xcall _LCD_write_string
.dbline 36
lds R2,_str8
lds R3,_str8+1
std y+1,R3
std y+0,R2
ldi R18,3
clr R16
xcall _LCD_write_string
.dbline 37
ldi R16,4000
ldi R17,15
xcall _delay_nms
.dbline 38
L9:
.dbline 25
xjmp L8
X0:
.dbline -2
L1:
adiw R28,2
.dbline 0 ; func end
ret
.dbend
.dbfunc e portinitial _portinitial fV
.even
_portinitial::
.dbline -1
.dbline 42
; while(1){
; LCD_write_char( 0x01, 0 ); //清屏
; LCD_write_string(2,0,str1);
; LCD_write_string(0,1,str2);
; LCD_write_string(0,2,str3);
; LCD_write_string(0,3,str4);
; delay_nms(4000);
; LCD_write_char( 0x01, 0 ); //清屏
; LCD_write_string(2,0,str5);
; LCD_write_string(0,1,str6);
; LCD_write_string(0,2,str7);
; LCD_write_string(0,3,str8);
; delay_nms(4000);
; }
; }
;
; void portinitial(void)
; {
.dbline 43
; DDRA=0XFF;
ldi R24,255
out 0x1a,R24
.dbline 44
; PORTA=0X00;
clr R2
out 0x1b,R2
.dbline 45
; DDRB=0XFF;
out 0x17,R24
.dbline 46
; PORTB=0XFF;
out 0x18,R24
.dbline 47
; LCD_RST_PORT |= LCD_RST;
sbi 0x18,3
.dbline 48
; LCD_PSB_PORT |= LCD_PSB;
sbi 0x18,2
.dbline -2
L11:
.dbline 0 ; func end
ret
.dbend
.area bss(ram, con, rel)
.dbfile D:\M16开发板实验教程\icc-avr\12864\12864_LCD_TEST.c
_str8::
.blkb 2
.dbsym e str8 _str8 pc
_str7::
.blkb 2
.dbsym e str7 _str7 pc
_str6::
.blkb 2
.dbsym e str6 _str6 pc
_str5::
.blkb 2
.dbsym e str5 _str5 pc
_str4::
.blkb 2
.dbsym e str4 _str4 pc
_str3::
.blkb 2
.dbsym e str3 _str3 pc
_str2::
.blkb 2
.dbsym e str2 _str2 pc
_str1::
.blkb 2
.dbsym e str1 _str1 pc
.area data(ram, con, rel)
.dbfile D:\M16开发板实验教程\icc-avr\12864\12864_LCD_TEST.c
L7:
.blkb 17
.area idata
.byte 178,162,208,208,215,220,207,223,189,211,183,168,193,183,207,176
.byte 0
.area data(ram, con, rel)
.dbfile D:\M16开发板实验教程\icc-avr\12864\12864_LCD_TEST.c
L6:
.blkb 15
.area idata
.byte 49,50,56,54,52,32,210,186,190,167,202,212,209,233,0
.area data(ram, con, rel)
.dbfile D:\M16开发板实验教程\icc-avr\12864\12864_LCD_TEST.c
L5:
.blkb 15
.area idata
.byte 50,48,48,55,196,234,49,49,212,194,214,198,215,247,0
.area data(ram, con, rel)
.dbfile D:\M16开发板实验教程\icc-avr\12864\12864_LCD_TEST.c
L4:
.blkb 15
.area idata
.byte 32,32,32,'d,'u,'s,'h,'i,'b,'i,'a,'o,32,32,0
.area data(ram, con, rel)
.dbfile D:\M16开发板实验教程\icc-avr\12864\12864_LCD_TEST.c
L3:
.blkb 14
.area idata
.byte 32,32,209,167,207,176,191,170,183,162,176,229,32,0
.area data(ram, con, rel)
.dbfile D:\M16开发板实验教程\icc-avr\12864\12864_LCD_TEST.c
L2:
.blkb 17
.area idata
.byte 'A,'V,'R,32,'M,'e,'g,'a,49,54,32,'B,'O,'A,'R,'D
.byte 0
.area data(ram, con, rel)
.dbfile D:\M16开发板实验教程\icc-avr\12864\12864_LCD_TEST.c
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -