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

📄 uart.s

📁 spi的i/o茉莉程序
💻 S
字号:
	.module uart.c
	.area text(rom, con, rel)
	.dbfile E:\新建文件夹\uart.c
	.dbfunc e Uart_init _Uart_init fV
	.even
_Uart_init::
	.dbline -1
	.dbline 5
; #include <iom8v.h>
; #include "uart.h"
; 
; void Uart_init(void)
; {
	.dbline 6
; UCSRB=((1<<RXEN)|(1<<TXEN));//
	ldi R24,24
	out 0xa,R24
	.dbline 7
; UBRRL=25;
	ldi R24,25
	out 0x9,R24
	.dbline 8
; UBRRH=0;//
	clr R2
	out 0x20,R2
	.dbline 9
; UCSRC=(1<<URSEL)|(1<<UCSZ1)|(1<<UCSZ0);
	ldi R24,134
	out 0x20,R24
	.dbline -2
L1:
	.dbline 0 ; func end
	ret
	.dbend
	.dbfunc e Send_abyte _Send_abyte fV
;          abyte -> R16
	.even
_Send_abyte::
	.dbline -1
	.dbline 13
; }
; 
; void Send_abyte(unsigned char abyte)
; {
L3:
	.dbline 14
L4:
	.dbline 14
; while(!(UCSRA&(1<<UDRE)));
	sbis 0xb,5
	rjmp L3
	.dbline 15
; UDR=abyte;
	out 0xc,R16
	.dbline -2
L2:
	.dbline 0 ; func end
	ret
	.dbsym r abyte 16 c
	.dbend
	.dbfunc e Receive_abyte _Receive_abyte fc
	.even
_Receive_abyte::
	.dbline -1
	.dbline 19
; }
; 
; unsigned char Receive_abyte(void)
; {
L7:
	.dbline 20
L8:
	.dbline 20
; while(!(UCSRA&(1<<RXC)));
	sbis 0xb,7
	rjmp L7
	.dbline 21
; return UDR;
	in R16,0xc
	.dbline -2
L6:
	.dbline 0 ; func end
	ret
	.dbend
	.dbfunc e Prints _Prints fV
;              i -> R20
;          enter -> R22
;         string -> R10,R11
	.even
_Prints::
	rcall push_gset3
	mov R22,R18
	movw R10,R16
	.dbline -1
	.dbline 26
; }
; 
; 
; void Prints(unsigned char *string,unsigned char enter)
; {
	.dbline 28
;  unsigned char i;
;  i=0;
	clr R20
	rjmp L12
X0:
	.dbline 30
;  while(string[i]!=0)    //判断字符串是否结束
;   {
L14:
	.dbline 31
L15:
	.dbline 31
	sbis 0xb,5
	rjmp L14
	.dbline 32
	mov R30,R20
	clr R31
	add R30,R10
	adc R31,R11
	ldd R2,z+0
	out 0xc,R2
	.dbline 33
	inc R20
	.dbline 34
L12:
	.dbline 29
	mov R30,R20
	clr R31
	add R30,R10
	adc R31,R11
	ldd R2,z+0
	tst R2
	brne L15
	.dbline 35
	tst R22
	breq L17
	.dbline 36
	.dbline 37
	ldi R16,10
	rcall _Send_abyte
	.dbline 38
	ldi R16,13
	rcall _Send_abyte
	.dbline 39
L17:
	.dbline -2
L10:
	rcall pop_gset3
	.dbline 0 ; func end
	ret
	.dbsym r i 20 c
	.dbsym r enter 22 c
	.dbsym r string 10 pc
	.dbend

⌨️ 快捷键说明

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