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

📄 mian.s

📁 LCD菜单的仿真及程序AVR_T6963.rar
💻 S
字号:
	.module mian.c
	.area text(rom, con, rel)
	.dbfile D:\NEW\AVR_T6963\mian.c
	.dbfunc e main _main fV
;              i -> R20
	.even
_main::
	sbiw R28,5
	.dbline -1
	.dbline 19
; #define MAIN_C
; /************************************************************************
; ;连线图: 液晶屏分为4 行*15列汉字使用间接操作方式
; ;*LCM--------------------------ATmega16*  
; ;*D0~D7                       PB0~PB7*
; *CD                            PA2*
; *RD                            PA1*
; *WR                            PA0*
; ;************************************************************************/
; /******************************************************/
; /* 本程序在晓奇程序的基础上改编*/
; /* Email: mymach@tom.com */
; /******************************************************/
; 
; #include "includes.h"
; 
; 
; void main(void) // 测试用
; {
	.dbline 21
;     unsigned char i;
;     DDRA = 0xFF;
	ldi R24,255
	out 0x1a,R24
	.dbline 22
;     PORTA = 0xff;
	out 0x1b,R24
	.dbline 23
;     shortdelay(1200);
	ldi R16,1200
	ldi R17,4
	xcall _shortdelay
	.dbline 25
;     //MCUCR = 0x00;
;     fnLCMInit();
	xcall _fnLCMInit
	.dbline 26
;     cls();
	xcall _cls
	.dbline 27
;     cursor(0,0);
	clr R18
	clr R16
	xcall _cursor
	.dbline 28
;     dprintf(12,1,"test for:中文测试");
	ldi R24,<L2
	ldi R25,>L2
	std y+1,R25
	std y+0,R24
	ldi R18,1
	ldi R16,12
	xcall _dprintf
	.dbline 29
;     dprintf(10,2,"T6963C use ATMega16");
	ldi R24,<L3
	ldi R25,>L3
	std y+1,R25
	std y+0,R24
	ldi R18,2
	ldi R16,10
	xcall _dprintf
	.dbline 30
;     dprintf(10,3,"~mymach~");
	ldi R24,<L4
	ldi R25,>L4
	std y+1,R25
	std y+0,R24
	ldi R18,3
	ldi R16,10
	xcall _dprintf
	.dbline 31
;     Linexy(5,5,80,5,8); // 画斜线1
	ldi R24,8
	std y+4,R24
	ldi R24,5
	std y+2,R24
	ldi R24,80
	std y+0,R24
	ldi R18,5
	ldi R16,5
	xcall _Linexy
	.dbline 32
;     Linexy(5,5,80,20,8); // 斜线2
	ldi R24,8
	std y+4,R24
	ldi R24,20
	std y+2,R24
	ldi R24,80
	std y+0,R24
	ldi R18,5
	ldi R16,5
	xcall _Linexy
	.dbline 33
;     Linexy(80,20,80,5,8); // 斜线3
	ldi R24,8
	std y+4,R24
	ldi R24,5
	std y+2,R24
	ldi R24,80
	std y+0,R24
	ldi R18,20
	ldi R16,80
	xcall _Linexy
	.dbline 35
;     
;     Linexy(2,2,238,2,8); // ------
	ldi R24,8
	std y+4,R24
	ldi R24,2
	std y+2,R24
	ldi R24,238
	std y+0,R24
	ldi R18,2
	ldi R16,2
	xcall _Linexy
	.dbline 36
;     Linexy(2,2,2,62,8); // |
	ldi R24,8
	std y+4,R24
	ldi R24,62
	std y+2,R24
	ldi R24,2
	std y+0,R24
	ldi R18,2
	ldi R16,2
	xcall _Linexy
	.dbline 37
;     circle(45,45,20,8); // 画圆 
	ldi R24,8
	std y+2,R24
	ldi R24,20
	std y+0,R24
	ldi R18,45
	ldi R16,45
	xcall _circle
	.dbline 38
;     circle(45,45,21,8); // 画同心圆加粗 
	ldi R24,8
	std y+2,R24
	ldi R24,21
	std y+0,R24
	ldi R18,45
	ldi R16,45
	xcall _circle
	.dbline 39
;     shortdelay(2000);
	ldi R16,2000
	ldi R17,7
	xcall _shortdelay
	xjmp L6
L5:
	.dbline 42
;     
;     while(1)
;     {
	.dbline 44
;         // 变化圆演示直径不断的变化由大到小再由小到大来回缩放
;         for (i=20;i>5;i--)
	ldi R20,20
	xjmp L11
L8:
	.dbline 45
	.dbline 46
	clr R2
	std y+2,R2
	mov R24,R20
	subi R24,255    ; addi 1
	std y+0,R24
	ldi R18,45
	ldi R16,45
	xcall _circle
	.dbline 47
	ldi R24,8
	std y+2,R24
	std y+0,R20
	ldi R18,45
	ldi R16,45
	xcall _circle
	.dbline 48
	ldi R24,8
	std y+2,R24
	mov R24,R20
	subi R24,1
	std y+0,R24
	ldi R18,45
	ldi R16,45
	xcall _circle
	.dbline 49
	ldi R16,300
	ldi R17,1
	xcall _shortdelay
	.dbline 50
L9:
	.dbline 44
	dec R20
L11:
	.dbline 44
	ldi R24,5
	cp R24,R20
	brlo L8
	.dbline 52
;         {
;             circle(45,45,i+1,0); // 擦除外圆
;             circle(45,45,i,8);
;             circle(45,45,i-1,8);
;             shortdelay(300);
;         }
;    
;         shortdelay(500);
	ldi R16,500
	ldi R17,1
	xcall _shortdelay
	.dbline 53
;         for (i=5;i<20;i++)
	ldi R20,5
	xjmp L15
L12:
	.dbline 54
	.dbline 55
	clr R2
	std y+2,R2
	mov R24,R20
	subi R24,1
	std y+0,R24
	ldi R18,45
	ldi R16,45
	xcall _circle
	.dbline 56
	ldi R24,8
	std y+2,R24
	std y+0,R20
	ldi R18,45
	ldi R16,45
	xcall _circle
	.dbline 57
	ldi R24,8
	std y+2,R24
	mov R24,R20
	subi R24,255    ; addi 1
	std y+0,R24
	ldi R18,45
	ldi R16,45
	xcall _circle
	.dbline 58
	ldi R16,200
	ldi R17,0
	xcall _shortdelay
	.dbline 59
L13:
	.dbline 53
	inc R20
L15:
	.dbline 53
	cpi R20,20
	brlo L12
	.dbline 60
	ldi R16,300
	ldi R17,1
	xcall _shortdelay
	.dbline 61
L6:
	.dbline 41
	xjmp L5
X0:
	.dbline -2
	.dbline 62
;         {
;             circle(45,45,i-1,0); // 擦除内圆
;             circle(45,45,i,8);
;             circle(45,45,i+1,8);
;             shortdelay(200);
;         }
;         shortdelay(300);
;     }
; }
L1:
	adiw R28,5
	.dbline 0 ; func end
	ret
	.dbsym r i 20 c
	.dbend
	.area data(ram, con, rel)
	.dbfile D:\NEW\AVR_T6963\mian.c
L4:
	.blkb 9
	.area idata
	.byte 126,'m,'y,'m,'a,'c,'h,126,0
	.area data(ram, con, rel)
	.dbfile D:\NEW\AVR_T6963\mian.c
L3:
	.blkb 20
	.area idata
	.byte 'T,54,57,54,51,'C,32,'u,'s,'e,32,'A,'T,'M,'e,'g
	.byte 'a,49,54,0
	.area data(ram, con, rel)
	.dbfile D:\NEW\AVR_T6963\mian.c
L2:
	.blkb 18
	.area idata
	.byte 't,'e,'s,'t,32,'f,'o,'r,58,214,208,206,196,178,226,202
	.byte 212,0
	.area data(ram, con, rel)
	.dbfile D:\NEW\AVR_T6963\mian.c

⌨️ 快捷键说明

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