📄 main.lst
字号:
###############################################################################
# #
# IAR ANSI C/C++ Compiler V6.40.1.53790/W32 for ARM 09/Aug/2012 09:28:56 #
# Copyright 1999-2012 IAR Systems AB. #
# #
# Cpu mode = thumb #
# Endian = little #
# Source file = C:\Users\305030973\Desktop\M4 #
# example\02_uart_loop\src\Sources\C\main.c #
# Command line = "C:\Users\305030973\Desktop\M4 #
# example\02_uart_loop\src\Sources\C\main.c" -D IAR -D #
# TWR_K60N512 -lCN "C:\Users\305030973\Desktop\M4 #
# example\02_uart_loop\bin\Flash\List\" -lB #
# "C:\Users\305030973\Desktop\M4 #
# example\02_uart_loop\bin\Flash\List\" -o #
# "C:\Users\305030973\Desktop\M4 #
# example\02_uart_loop\bin\Flash\Obj\" --no_cse #
# --no_unroll --no_inline --no_code_motion --no_tbaa #
# --no_clustering --no_scheduling --debug --endian=little #
# --cpu=Cortex-M4 -e --fpu=None --dlib_config "C:\Program #
# Files\IAR Systems\Embedded Workbench #
# 6.4_2\arm\INC\c\DLib_Config_Normal.h" -I #
# "C:\Users\305030973\Desktop\M4 #
# example\02_uart_loop\src\Sources\H\" -I #
# "C:\Users\305030973\Desktop\M4 #
# example\02_uart_loop\src\Sources\H\Component_H\" -I #
# "C:\Users\305030973\Desktop\M4 #
# example\02_uart_loop\src\Sources\H\Frame_H\" -Ol #
# --use_c++_inline #
# List file = C:\Users\305030973\Desktop\M4 #
# example\02_uart_loop\bin\Flash\List\main.lst #
# Object file = C:\Users\305030973\Desktop\M4 #
# example\02_uart_loop\bin\Flash\Obj\main.o #
# #
# #
###############################################################################
C:\Users\305030973\Desktop\M4 example\02_uart_loop\src\Sources\C\main.c
1 //-------------------------------------------------------------------------*
2 // 工 程 名: uart_loop *
3 // 硬件连接: 将K60核心板与扩展板连接 *
4 // 程序描述: 启动后发送"Hello World!",之后等待接收一个字节数据,收到后回发*
5 // 目 的: 初步掌握利用查询方式进行串行通信的基本知识 *
6 // 说 明: 波特率为9600,使用UART3口 *
7 //---------------苏州大学飞思卡尔嵌入式系统实验室2011年--------------------*
8
9 //头文件
10 #include "includes.h"
11
12 //全局变量声明
13 extern int periph_clk_khz;
14
15 //主函数
\ In section .text, align 4, keep-with-next
16 void main(void)
17 {
\ main:
\ 00000000 0xB082 SUB SP,SP,#+8
18 //1 主程序使用的变量定义
19 uint32 runcount; //运行计数器
20 uint8 ch;
21
22 //2 关中断
23 DisableInterrupts; //禁止总中断
\ 00000002 0xB672 CPSID i
24
25 //3 模块初始化
26 light_init(Light_Run_PORT,Light_Run1,Light_OFF); //指示灯初始化
\ 00000004 0x2201 MOVS R2,#+1
\ 00000006 0x210D MOVS R1,#+13
\ 00000008 0x4811 LDR.N R0,??main_0 ;; 0x400ff080
\ 0000000A 0x.... 0x.... BL light_init
27 uart_init (UART3,periph_clk_khz,9600); //串口初始化
\ 0000000E 0xF44F 0x5216 MOV R2,#+9600
\ 00000012 0x4810 LDR.N R0,??main_0+0x4
\ 00000014 0x6801 LDR R1,[R0, #+0]
\ 00000016 0x4810 LDR.N R0,??main_0+0x8 ;; 0x4006d000
\ 00000018 0x.... 0x.... BL uart_init
28
29
30 //4 开中断
31
32 uart_sendN(UART3,(uint8*)"Hello World!",12);
\ 0000001C 0x220C MOVS R2,#+12
\ 0000001E 0x490F LDR.N R1,??main_0+0xC
\ 00000020 0x480D LDR.N R0,??main_0+0x8 ;; 0x4006d000
\ 00000022 0x.... 0x.... BL uart_sendN
33 //主循环
34 while(1)
35 {
36 //1 主循环计数到一定的值,使小灯的亮、暗状态切换
37 runcount++;
\ ??main_1:
\ 00000026 0x1C64 ADDS R4,R4,#+1
38 if(runcount>=10)
\ 00000028 0x2C0A CMP R4,#+10
\ 0000002A 0xD304 BCC.N ??main_2
39 {
40 light_change(Light_Run_PORT,Light_Run1);//指示灯的亮、暗状态切换
\ 0000002C 0x210D MOVS R1,#+13
\ 0000002E 0x4808 LDR.N R0,??main_0 ;; 0x400ff080
\ 00000030 0x.... 0x.... BL light_change
41 runcount=0;
\ 00000034 0x2400 MOVS R4,#+0
42 }
43 //2 串口接收一个字节的数据
44 if(uart_reN(UART3,&ch,1))
\ ??main_2:
\ 00000036 0x2201 MOVS R2,#+1
\ 00000038 0xA900 ADD R1,SP,#+0
\ 0000003A 0x4807 LDR.N R0,??main_0+0x8 ;; 0x4006d000
\ 0000003C 0x.... 0x.... BL uart_reN
\ 00000040 0x2800 CMP R0,#+0
\ 00000042 0xD0F0 BEQ.N ??main_1
45 {
46 uart_send1(UART3,ch); //发送回去
\ 00000044 0xF89D 0x1000 LDRB R1,[SP, #+0]
\ 00000048 0x4803 LDR.N R0,??main_0+0x8 ;; 0x4006d000
\ 0000004A 0x.... 0x.... BL uart_send1
\ 0000004E 0xE7EA B.N ??main_1
\ ??main_0:
\ 00000050 0x400FF080 DC32 0x400ff080
\ 00000054 0x........ DC32 periph_clk_khz
\ 00000058 0x4006D000 DC32 0x4006d000
\ 0000005C 0x........ DC32 `?<Constant "Hello World!">`
47 }
48
49 }
50 }
\ In section .rodata, align 4
\ `?<Constant "Hello World!">`:
\ 00000000 0x48 0x65 DC8 "Hello World!"
\ 0x6C 0x6C
\ 0x6F 0x20
\ 0x57 0x6F
\ 0x72 0x6C
\ 0x64 0x21
\ 0x00
\ 0000000D 0x00 0x00 DC8 0, 0, 0
\ 0x00
51
52
53
54
Maximum stack usage in bytes:
.cstack Function
------- --------
8 main
8 -> light_change
8 -> light_init
8 -> uart_init
8 -> uart_reN
8 -> uart_send1
8 -> uart_sendN
Section sizes:
Bytes Function/Label
----- --------------
16 ?<Constant "Hello World!">
96 main
16 bytes in section .rodata
96 bytes in section .text
96 bytes of CODE memory
16 bytes of CONST memory
Errors: none
Warnings: none
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -