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

📄 main.s

📁 AVR单片机 C语言程序设计经典实用
💻 S
字号:
	.module main.c
	.area text(rom, con, rel)
	.dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\LED大屏幕显示系统设计\main.c
	.dbfunc e main _main fV
	.even
_main::
	.dbline -1
	.dbline 15
; //***************************************************************
; // File Name : LED.c
; // Author    : Steaven
; // Created   : 2008-07-26
; // Modified  : 
; // Revision  : V0.0
; //***************************************************************
; 
; #include "iom16v.h"
; #include "DataType.h"
; #include "app.h" 
; #include "LED.h"
;     
; void main(void)
; {
	.dbline 16
; 	Hardware_Init();
	xcall _Hardware_Init
	.dbline 17
; 	Display_Init();
	xcall _Display_Init
	.dbline 18
; 	DotTest();
	xcall _DotTest
	.dbline 19
; 	Interrupt_Init();
	xcall _Interrupt_Init
L2:
	.dbline 20
	.dbline 20
	.dbline 20
L3:
	.dbline 20
	xjmp L2
X0:
	.dbline -2
	.dbline 21
; 	while(1) {;}
; }
L1:
	.dbline 0 ; func end
	ret
	.dbend
	.area vector(rom, abs)
	.org 76
	jmp _Timer0_Interrupt
	.area text(rom, con, rel)
	.dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\LED大屏幕显示系统设计\main.c
	.area data(ram, con, rel)
	.dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\LED大屏幕显示系统设计\main.c
L6:
	.blkb 1
	.area idata
	.byte 0
	.area data(ram, con, rel)
	.dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\LED大屏幕显示系统设计\main.c
	.area text(rom, con, rel)
	.dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\LED大屏幕显示系统设计\main.c
	.dbfunc e Timer0_Interrupt _Timer0_Interrupt fV
	.dbsym s Index L6 c
	.even
_Timer0_Interrupt::
	st -y,R2
	st -y,R3
	st -y,R16
	st -y,R17
	st -y,R24
	st -y,R25
	st -y,R30
	st -y,R31
	in R2,0x3f
	st -y,R2
	.dbline -1
	.dbline 31
	.dbline 34
	in R24,0x38
	ori R24,2
	out 0x38,R24
	.dbline 35
	clr R2
	out 0x32,R2
	.dbline 37
	out 0x1b,R2
	.dbline 38
	lds R17,L6
	ldi R16,1
	xcall lsl8
	mov R2,R16
	com R2
	out 0x12,R2
	.dbline 39
	ldi R24,<_Buffer
	ldi R25,>_Buffer
	lds R30,L6
	clr R31
	add R30,R24
	adc R31,R25
	ldd R2,z+0
	out 0x1b,R2
	.dbline 40
	lds R2,L6
	clr R3
	mov R24,R2
	subi R24,255    ; addi 1
	sts L6,R24
	mov R24,R2
	cpi R24,8
	brlo L7
	.dbline 41
	.dbline 42
	clr R2
	sts L6,R2
	.dbline 43
L7:
	.dbline -2
	.dbline 44
; 
; //***************************************************************
; // Function    : Timer0_Interrupt
; // Input       : none
; // Output      : none
; // Description : ATmega16 T/C0 ISR
; //***************************************************************
; #pragma interrupt_handler Timer0_Interrupt:20
; void Timer0_Interrupt(void)
; {
; 	static INT8U Index = 0;
; 	//Clear Timer0 OCIF Flag
; 	TIFR  |= 0x02;
; 	TCNT0  = 0x00;
; 	//Display Control
; 	PORTA = 0x00;
; 	PORTD = ~(1 << Index);
; 	PORTA = *(Buffer + Index);
; 	if(Index++ >= 8)
; 	{
; 	   Index = 0;
; 	}  
; }
L5:
	ld R2,y+
	out 0x3f,R2
	ld R31,y+
	ld R30,y+
	ld R25,y+
	ld R24,y+
	ld R17,y+
	ld R16,y+
	ld R3,y+
	ld R2,y+
	.dbline 0 ; func end
	reti
	.dbend
	.area vector(rom, abs)
	.org 24
	jmp _Timer1_Interrupt
	.area text(rom, con, rel)
	.dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\LED大屏幕显示系统设计\main.c
	.area bss(ram, con, rel)
	.dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\LED大屏幕显示系统设计\main.c
L10:
	.blkb 1
	.area text(rom, con, rel)
	.dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\LED大屏幕显示系统设计\main.c
	.dbfunc e Timer1_Interrupt _Timer1_Interrupt fV
	.dbsym s Index L10 c
;           temp -> <dead>
	.even
_Timer1_Interrupt::
	xcall push_lset
	.dbline -1
	.dbline 54
; 
; //***************************************************************
; // Function    : Timer1_Interrupt
; // Input       : none
; // Output      : none
; // Description : ATmega16 T/C1 ISR
; //***************************************************************
; #pragma interrupt_handler Timer1_Interrupt:7
; void Timer1_Interrupt(void)
; {
	.dbline 58
; 	INT8U temp;
; 	static INT8U Index;
; 	//Clear Timer1 OCIF Flag
; 	TIFR  |= 0x10;
	in R24,0x38
	ori R24,16
	out 0x38,R24
	.dbline 59
; 	TCNT1  = 0x00;
	clr R2
	clr R3
	out 0x2d,R3
	out 0x2c,R2
	.dbline 61
; 	//Buffer Control
; 	if(Index++ >= 8)
	lds R2,L10
	clr R3
	mov R24,R2
	subi R24,255    ; addi 1
	sts L10,R24
	mov R24,R2
	cpi R24,8
	brlo L11
	.dbline 62
; 	{
	.dbline 63
; 		Index = 0;
	clr R2
	sts L10,R2
	.dbline 64
; 		pBufStr++;
	lds R24,_pBufStr
	lds R25,_pBufStr+1
	adiw R24,1
	sts _pBufStr+1,R25
	sts _pBufStr,R24
	.dbline 65
; 		if(*pBufStr == '\0')
	movw R30,R24
	lpm R30,Z
	tst R30
	brne L13
	.dbline 66
; 		{
	.dbline 67
; 			pBufStr = String1;
	ldi R24,<_String1
	ldi R25,>_String1
	sts _pBufStr+1,R25
	sts _pBufStr,R24
	.dbline 68
; 		}
L13:
	.dbline 69
; 	}
L11:
	.dbline 70
; 	Buffer_IN(Index);
	lds R16,L10
	xcall _Buffer_IN
	.dbline -2
	.dbline 71
; }
L9:
	xcall pop_lset
	.dbline 0 ; func end
	reti
	.dbsym l temp 1 c
	.dbend

⌨️ 快捷键说明

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