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

📄 debug.s

📁 AVRmega28L的串口发送数据程序
💻 S
字号:
	.module debug.c
	.area text(rom, con, rel)
	.dbfile F:\我的BACK\淘宝\128开发板\程序\128L_USART1\debug.c
	.dbfunc e Usart0_byte _Usart0_byte fV
;        OneByte -> R16
	.even
_Usart0_byte::
	.dbline -1
	.dbline 5
; #include "config.h"
; 
; 
; void Usart0_byte( BYTE OneByte )
;   {     
L2:
	.dbline 6
L3:
	.dbline 6
;       while ( ! (UCSR0A & (1 << UDRE0) ) );    /* Waiting for empty transmit buffer */              
	sbis 0xb,5
	rjmp L2
	.dbline 7
;       UDR0 = OneByte;     
	out 0xc,R16
L5:
	.dbline 8
L6:
	.dbline 8
;       while( ! (UCSR0A & (1 << TXC0) ) );                
	sbis 0xb,6
	rjmp L5
	.dbline -2
L1:
	.dbline 0 ; func end
	ret
	.dbsym r OneByte 16 c
	.dbend
	.dbfunc e Usart1_byte _Usart1_byte fV
;        OneByte -> R16
	.even
_Usart1_byte::
	.dbline -1
	.dbline 11
;   }
; void Usart1_byte(BYTE OneByte)
; {
L9:
	.dbline 20
L10:
	.dbline 20
; 	/*///while (!CHECK_BIT(UCSR0A,1<<UDRE0));
; 	int i,j;
; 	UDR0 = data ;
; 	for(i=0;i<200;i++)
; 		for(j=0;j<200;j++);
; 	///while (!CHECK_BIT(UCSR0A, 1<<TXC0));
; 	
; 	return 0;*/
; 	while ( ! (UCSR1A & (1 << UDRE1) ) );    /* Waiting for empty transmit buffer */              
	lds R2,155
	sbrs R2,5
	rjmp L9
	.dbline 21
;       UDR1 = OneByte;     
	sts 156,R16
L12:
	.dbline 22
L13:
	.dbline 22
;       while( ! (UCSR1A & (1 << TXC1) ) );     
	lds R2,155
	sbrs R2,6
	rjmp L12
	.dbline -2
L8:
	.dbline 0 ; func end
	ret
	.dbsym r OneByte 16 c
	.dbend
	.dbfunc e debug0_Print _debug0_Print fV
;            buf -> R20,R21
	.even
_debug0_Print::
	xcall push_gset1
	movw R20,R16
	.dbline -1
	.dbline 27
; } 
;   
;   
; void debug0_Print(char* buf)
; {
	xjmp L17
L16:
	.dbline 29
	.dbline 30
	movw R30,R20
	ldd R16,z+0
	xcall _Usart0_byte
	.dbline 31
	subi R20,255  ; offset = 1
	sbci R21,255
	.dbline 32
L17:
	.dbline 28
;        while ( *buf != '\0' )
	movw R30,R20
	ldd R2,z+0
	tst R2
	brne L16
	.dbline -2
L15:
	xcall pop_gset1
	.dbline 0 ; func end
	ret
	.dbsym r buf 20 pc
	.dbend
	.dbfunc e debug1_Print _debug1_Print fV
;            buf -> R20,R21
	.even
_debug1_Print::
	xcall push_gset1
	movw R20,R16
	.dbline -1
	.dbline 36
;         {
;             Usart0_byte( *buf );
;             buf++;                                  
;         }
; }
;   
; void debug1_Print(char* buf)
; {
	xjmp L21
L20:
	.dbline 38
	.dbline 39
	movw R30,R20
	ldd R16,z+0
	xcall _Usart1_byte
	.dbline 40
	subi R20,255  ; offset = 1
	sbci R21,255
	.dbline 41
L21:
	.dbline 37
;        while ( *buf != '\0' )
	movw R30,R20
	ldd R2,z+0
	tst R2
	brne L20
	.dbline -2
L19:
	xcall pop_gset1
	.dbline 0 ; func end
	ret
	.dbsym r buf 20 pc
	.dbend

⌨️ 快捷键说明

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