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

📄 jidianqi.s

📁 基于AVR的数码管显示程序。是学习单片机入门级程序。 本程序出自高手之手
💻 S
字号:
	.module jidianqi.c
	.area text(rom, con, rel)
	.dbfile I:\AVR视频教程\视频教程\lesson3\jidianqi\jidianqi.c
	.dbfunc e main _main fV
;              i -> R16,R17
	.even
_main::
	.dbline -1
	.dbline 8
; #include <iom16v.h>
; #include <macros.h>
; 
; #define uchar unsigned char
; #define uint  unsigned int
; 
; void main()
; {
	.dbline 10
; 
;  	 uint i; 	DDRC|=BIT(PC6);
	sbi 0x14,6
	xjmp L3
L2:
	.dbline 14
; 	// DDRA|=BIT(2);
;    //  PORTA|=BIT(2);     DDRB=0XFF;
;       while(1)
; 	{
	.dbline 17
; 
; 
; 	PORTC|=BIT(6);
	sbi 0x15,6
	.dbline 18
; 	 i=50000;
	ldi R16,50000
	ldi R17,195
L5:
	.dbline 19
L6:
	.dbline 19
; 	 while(i--);	 i=50000;
	movw R2,R16
	subi R16,1
	sbci R17,0
	tst R2
	brne L5
	tst R3
	brne L5
X0:
	.dbline 19
	ldi R16,50000
	ldi R17,195
L8:
	.dbline 20
L9:
	.dbline 20
; 	 while(i--);
	movw R2,R16
	subi R16,1
	sbci R17,0
	tst R2
	brne L8
	tst R3
	brne L8
X1:
	.dbline 22
; 	 //DDRB=0XFF;
;  	 PORTC&=~BIT(6);
	cbi 0x15,6
	.dbline 23
; 	 i=50000;
	ldi R16,50000
	ldi R17,195
L11:
	.dbline 24
L12:
	.dbline 24
; 	 while(i--); 	 i=50000;
	movw R2,R16
	subi R16,1
	sbci R17,0
	tst R2
	brne L11
	tst R3
	brne L11
X2:
	.dbline 24
	ldi R16,50000
	ldi R17,195
L14:
	.dbline 25
L15:
	.dbline 25
	movw R2,R16
	subi R16,1
	sbci R17,0
	tst R2
	brne L14
	tst R3
	brne L14
X3:
	.dbline 26
L3:
	.dbline 13
	xjmp L2
X4:
	.dbline -2
	.dbline 27
; 	 while(i--);
;     }
; }
L1:
	.dbline 0 ; func end
	ret
	.dbsym r i 16 i
	.dbend

⌨️ 快捷键说明

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