📄 lib_str.lst
字号:
##############################################################################
# #
# IAR ARM ANSI C/C++ Compiler V4.42A/W32 KICKSTART 26/Dec/2008 18:22:01 #
# Copyright 1999-2005 IAR Systems. All rights reserved. #
# #
# Cpu mode = thumb #
# Endian = little #
# Stack alignment = 4 #
# Source file = F:\PROJECT\STM32_UCOSII\uC-LIB\lib_str.c #
# Command line = F:\PROJECT\STM32_UCOSII\uC-LIB\lib_str.c -lCN #
# F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
# IAR\OS-Probe\Flash\List\ -o #
# F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
# IAR\OS-Probe\Flash\Obj\ -z6 --no_unroll --no_inline #
# --no_tbaa --no_scheduling --debug --cpu_mode thumb #
# --endian little --cpu cortex-M3 --stack_align 4 -e #
# --fpu None --dlib_config "E:\Program Files\IAR #
# Systems\Embedded Workbench 4.0 #
# Kickstart\arm\LIB\dl7mptnnl8n.h" -I #
# F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
# IAR\OS-Probe\ -I F:\PROJECT\STM32_UCOSII\EvalBoards\ #
# ST\STM3210E-EVAL\IAR\OS-Probe\..\BSP\ -I #
# F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
# IAR\OS-Probe\..\..\..\..\..\CPU\ST\STM32\inc\ -I #
# F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
# IAR\OS-Probe\..\..\..\..\..\uC-CPU\ -I #
# F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
# IAR\OS-Probe\..\..\..\..\..\uC-CPU\ARM-Cortex-M3\IAR #
# \ -I F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E- #
# EVAL\IAR\OS-Probe\..\..\..\..\..\uC-LCD\Source\ -I #
# F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
# IAR\OS-Probe\..\..\..\..\..\uC-LIB\ -I #
# F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
# IAR\OS-Probe\..\..\..\..\..\uCOS-II\Ports\ARM-Cortex #
# -M3\Generic\IAR\ -I F:\PROJECT\STM32_UCOSII\EvalBoar #
# ds\ST\STM3210E-EVAL\IAR\OS-Probe\..\..\..\..\..\uCOS #
# -II\Source\ -I F:\PROJECT\STM32_UCOSII\EvalBoards\ST #
# \STM3210E-EVAL\IAR\OS-Probe\..\..\..\..\..\uC-Probe\ #
# Target\Communication\Generic\RS-232\Source\ -I #
# F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
# IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Communic #
# ation\Generic\RS-232\Ports\ST\STM32\ -I #
# F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
# IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Communic #
# ation\Generic\Source\ -I F:\PROJECT\STM32_UCOSII\Eva #
# lBoards\ST\STM3210E-EVAL\IAR\OS-Probe\..\..\..\..\.. #
# \uC-Probe\Target\Plugins\uCOS-II\ -I "E:\Program #
# Files\IAR Systems\Embedded Workbench 4.0 #
# Kickstart\arm\INC\" #
# List file = F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
# IAR\OS-Probe\Flash\List\lib_str.lst #
# Object file = F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
# IAR\OS-Probe\Flash\Obj\lib_str.r79 #
# #
# #
##############################################################################
F:\PROJECT\STM32_UCOSII\uC-LIB\lib_str.c
1 /*
2 *********************************************************************************************************
3 * uC/LIB
4 * CUSTOM LIBRARY MODULES
5 *
6 * (c) Copyright 2004-2008; Micrium, Inc.; Weston, FL
7 *
8 * All rights reserved. Protected by international copyright laws.
9 *
10 * uC/LIB is provided in source form for FREE evaluation, for educational
11 * use or peaceful research. If you plan on using uC/LIB in a commercial
12 * product you need to contact Micrium to properly license its use in your
13 * product. We provide ALL the source code for your convenience and to
14 * help you experience uC/LIB. The fact that the source code is provided
15 * does NOT mean that you can use it without paying a licensing fee.
16 *
17 * Knowledge of the source code may NOT be used to develop a similar product.
18 *
19 * Please help us continue to provide the Embedded community with the finest
20 * software available. Your honesty is greatly appreciated.
21 *********************************************************************************************************
22 */
23
24 /*
25 *********************************************************************************************************
26 *
27 * ASCII STRING MANAGEMENT
28 *
29 * Filename : lib_str.c
30 * Version : V1.25
31 * Programmer(s) : ITJ
32 * JDH
33 *********************************************************************************************************
34 * Note(s) : (1) NO compiler-supplied standard library functions are used in library or product software.
35 *
36 * (a) ALL standard library functions are implemented in the custom library modules :
37 *
38 * (1) \<Custom Library Directory>\lib*.*
39 *
40 * (2) \<Custom Library Directory>\Ports\<cpu>\<compiler>\lib*_a.*
41 *
42 * where
43 * <Custom Library Directory> directory path for custom library software
44 * <cpu> directory name for specific processor (CPU)
45 * <compiler> directory name for specific compiler
46 *
47 * (b) Product-specific library functions are implemented in individual products.
48 *********************************************************************************************************
49 */
50
51
52 /*
53 *********************************************************************************************************
54 * INCLUDE FILES
55 *********************************************************************************************************
56 */
57
58 #define LIB_STR_MODULE
59 #include <lib_str.h>
60
61
62 /*$PAGE*/
63 /*
64 *********************************************************************************************************
65 * LOCAL DEFINES
66 *********************************************************************************************************
67 */
68
69
70 /*
71 *********************************************************************************************************
72 * LOCAL CONSTANTS
73 *********************************************************************************************************
74 */
75
76
77 /*
78 *********************************************************************************************************
79 * LOCAL DATA TYPES
80 *********************************************************************************************************
81 */
82
83
84 /*
85 *********************************************************************************************************
86 * LOCAL TABLES
87 *********************************************************************************************************
88 */
89
90
91 /*
92 *********************************************************************************************************
93 * LOCAL GLOBAL VARIABLES
94 *********************************************************************************************************
95 */
96
97
98 /*
99 *********************************************************************************************************
100 * LOCAL FUNCTION PROTOTYPES
101 *********************************************************************************************************
102 */
103
104
105 /*
106 *********************************************************************************************************
107 * LOCAL CONFIGURATION ERRORS
108 *********************************************************************************************************
109 */
110
111
112 /*$PAGE*/
113 /*
114 *********************************************************************************************************
115 * Str_Len()
116 *
117 * Description : Calculate length of a string.
118 *
119 * Argument(s) : pstr Pointer to string (see Note #1).
120 *
121 * Return(s) : Length of string; number of characters in string before terminating NULL character.
122 *
123 * Caller(s) : Application.
124 *
125 * Note(s) : (1) String buffer NOT modified.
126 *
127 * (2) String length calculation terminates when :
128 *
129 * (a) String pointer points to NULL.
130 * (1) String buffer overlaps with NULL address.
131 * (2) String length calculated for string up to but NOT beyond or including
132 * the NULL address.
133 *
134 * (b) Terminating NULL character found.
135 * (1) String length calculated for string up to but NOT including
136 * the NULL character.
137 *********************************************************************************************************
138 */
139
\ In segment CODE, align 4, keep-with-next
140 CPU_SIZE_T Str_Len (CPU_CHAR *pstr)
141 {
\ Str_Len:
\ 00000000 0100 MOVS R1,R0
142 CPU_SIZE_T len;
143
144
145 len = 0;
\ 00000002 0020 MOVS R0,#+0
\ 00000004 01E0 B.N ??Str_Len_0
146 while (( pstr != (CPU_CHAR *)0) && /* Calc str len until NULL ptr (see Note #2a) ... */
147 (*pstr != (CPU_CHAR )0)) { /* ... or NULL char found (see Note #2b). */
148 len++;
\ ??Str_Len_1:
\ 00000006 401C ADDS R0,R0,#+1
149 pstr++;
\ 00000008 491C ADDS R1,R1,#+1
150 }
\ ??Str_Len_0:
\ 0000000A 0029 CMP R1,#+0
\ 0000000C 02D0 BEQ.N ??Str_Len_2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -