?? uarst.lis
字號:
.module uarst.c
.area text(rom, con, rel)
0000 .dbfile E:\5按鍵_SD卡MP3程序\uarst.c
0000 .dbfunc e uart0_init _uart0_init fV
.even
0000 _uart0_init::
0000 .dbline -1
0000 .dbline 17
0000 ; /************************************************************/
0000 ; /* UARST Code for M32L */
0000 ; /* By pasyong */
0000 ; /* 2006-4 */
0000 ; /* Base ICC6.31A */
0000 ; /************************************************************/
0000 ; #include <iom32v.h>
0000 ; #include <macros.h>
0000 ; #include <stdio.h>
0000 ;
0000 ; //UART0 initialize
0000 ; // desired baud rate: 9600
0000 ; // actual: baud rate:9600 (0.0%)
0000 ; // char size: 8 bit
0000 ; // parity: Disabled
0000 ; void uart0_init(void)
0000 ; {
0000 .dbline 18
0000 ; UCSRB = 0x00; //disable while setting baud rate
0000 2224 clr R2
0002 2AB8 out 0xa,R2
0004 .dbline 19
0004 ; UCSRA = 0x00;
0004 2BB8 out 0xb,R2
0006 .dbline 20
0006 ; UCSRC = BIT(URSEL) | 0x06;
0006 86E8 ldi R24,134
0008 80BD out 0x20,R24
000A .dbline 21
000A ; UBRRL = 0x2F; //set baud rate lo
000A 8FE2 ldi R24,47
000C 89B9 out 0x9,R24
000E .dbline 22
000E ; UBRRH = 0x00; //set baud rate hi
000E 20BC out 0x20,R2
0010 .dbline 23
0010 ; UCSRB = 0x18;
0010 88E1 ldi R24,24
0012 8AB9 out 0xa,R24
0014 .dbline -2
0014 .dbline 24
0014 ; }
0014 L1:
0014 .dbline 0 ; func end
0014 0895 ret
0016 .dbend
0016 .dbfunc e Puts _Puts fV
0016 ; s -> R20,R21
.even
0016 _Puts::
0016 0E940000 xcall push_gset1
001A A801 movw R20,R16
001C .dbline -1
001C .dbline 27
001C ; //串口輸出字符串
001C ; void Puts( unsigned char *s)
001C ; {
001C 06C0 xjmp L4
001E L3:
001E .dbline 29
001E .dbline 30
001E FA01 movw R30,R20
0020 0081 ldd R16,z+0
0022 0E940000 xcall _putchar
0026 .dbline 31
0026 4F5F subi R20,255 ; offset = 1
0028 5F4F sbci R21,255
002A .dbline 32
002A L4:
002A .dbline 28
002A ; while (*s)
002A FA01 movw R30,R20
002C 2080 ldd R2,z+0
002E 2220 tst R2
0030 B1F7 brne L3
0032 .dbline -2
0032 .dbline 33
0032 ; {
0032 ; putchar(*s);
0032 ; s++;
0032 ; }
0032 ; }
0032 L2:
0032 0E940000 xcall pop_gset1
0036 .dbline 0 ; func end
0036 0895 ret
0038 .dbsym r s 20 pc
0038 .dbend
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -