📄 lib_str.lst
字号:
##############################################################################
# #
# IAR ARM ANSI C/C++ Compiler V4.42A/W32 KICKSTART 10/Jan/2008 14:56:29 #
# Copyright 1999-2005 IAR Systems. All rights reserved. #
# #
# Cpu mode = arm #
# Endian = little #
# Stack alignment = 4 #
# Source file = D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
# \uC-LIB\lib_str.c #
# Command line = D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
# \uC-LIB\lib_str.c -lCN D:\work\资料\嵌入式操作系统\U #
# COS-II\Micrium\Software\EvalBoards\NXP\LPC2468-EA\IA #
# R\OS-View\RAM\List\ -o D:\work\资料\嵌入式操作系统\U #
# COS-II\Micrium\Software\EvalBoards\NXP\LPC2468-EA\IA #
# R\OS-View\RAM\Obj\ -z2 --no_cse --no_unroll #
# --no_inline --no_code_motion --no_tbaa #
# --no_clustering --no_scheduling --debug --cpu_mode #
# arm --endian little --cpu ARM7TDMI-S --stack_align #
# 4 -e --fpu None --dlib_config "C:\Program Files\IAR #
# Systems\Embedded Workbench 4.0 #
# Kickstart\arm\LIB\dl4tpannl8n.h" -I #
# D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
# \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\ -I #
# D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
# \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\..\..\..\..\. #
# .\ucos-ii\ports\arm\generic\iar\ -I #
# D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
# \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\..\..\..\..\. #
# .\ucos-ii\source\ -I D:\work\资料\嵌入式操作系统\UCO #
# S-II\Micrium\Software\EvalBoards\NXP\LPC2468-EA\IAR\ #
# OS-View\..\..\..\..\..\uc-lib\ -I #
# D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
# \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\..\..\..\..\. #
# .\uc-cpu\ -I D:\work\资料\嵌入式操作系统\UCOS-II\Mic #
# rium\Software\EvalBoards\NXP\LPC2468-EA\IAR\OS-View\ #
# ..\..\..\..\..\uc-cpu\arm\IAR\ -I #
# D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
# \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\..\BSP\ -I #
# "C:\Program Files\IAR Systems\Embedded Workbench #
# 4.0 Kickstart\arm\INC\" #
# List file = D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
# \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\RAM\List\lib_ #
# str.lst #
# Object file = D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
# \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\RAM\Obj\lib_s #
# tr.r79 #
# #
# #
##############################################################################
D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software\uC-LIB\lib_str.c
1 /*
2 *********************************************************************************************************
3 * uC/LIB
4 * CUSTOM LIBRARY MODULES
5 *
6 * (c) Copyright 2004-2007; 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.23
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 * INCLUDE FILES
54 *********************************************************************************************************
55 */
56
57 #define LIB_STR_MODULE
58 #include <lib_str.h>
59
60
61 /*$PAGE*/
62 /*
63 *********************************************************************************************************
64 * LOCAL DEFINES
65 *********************************************************************************************************
66 */
67
68
69 /*
70 *********************************************************************************************************
71 * LOCAL CONSTANTS
72 *********************************************************************************************************
73 */
74
75
76 /*
77 *********************************************************************************************************
78 * LOCAL DATA TYPES
79 *********************************************************************************************************
80 */
81
82
83 /*
84 *********************************************************************************************************
85 * LOCAL TABLES
86 *********************************************************************************************************
87 */
88
89
90 /*
91 *********************************************************************************************************
92 * LOCAL GLOBAL VARIABLES
93 *********************************************************************************************************
94 */
95
96
97 /*
98 *********************************************************************************************************
99 * LOCAL FUNCTION PROTOTYPES
100 *********************************************************************************************************
101 */
102
103
104 /*
105 *********************************************************************************************************
106 * LOCAL CONFIGURATION ERRORS
107 *********************************************************************************************************
108 */
109
110
111 /*$PAGE*/
112 /*
113 *********************************************************************************************************
114 * Str_Len()
115 *
116 * Description : Calculate length of a string.
117 *
118 * Argument(s) : pstr Pointer to string (see Note #1).
119 *
120 * Return(s) : Length of string; number of characters in string before terminating NULL character.
121 *
122 * Caller(s) : various.
123 *
124 * Note(s) : (1) String buffer NOT modified.
125 *
126 * (2) String length calculation terminates when :
127 *
128 * (a) String pointer points to NULL.
129 * (1) String buffer overlaps with NULL address.
130 * (2) String length calculated for string up to but NOT beyond or including
131 * the NULL address.
132 *
133 * (b) Terminating NULL character found.
134 * (1) String length calculated for string up to but NOT including
135 * the NULL character.
136 *********************************************************************************************************
137 */
138
\ In segment CODE, align 4, keep-with-next
139 CPU_SIZE_T Str_Len (CPU_CHAR *pstr)
140 {
\ Str_Len:
\ 00000000 0010B0E1 MOVS R1,R0
141 CPU_SIZE_T len;
142
143
144 len = 0;
\ 00000004 0020A0E3 MOV R2,#+0
\ 00000008 0200B0E1 MOVS R0,R2
145 while (( pstr != (CPU_CHAR *)0) && /* Calc str len until NULL ptr (see Note #2a) ... */
146 (*pstr != (CPU_CHAR )0)) { /* ... or NULL char found (see Note #2b). */
\ ??Str_Len_0:
\ 0000000C 000051E3 CMP R1,#+0
\ 00000010 0500000A BEQ ??Str_Len_1
\ 00000014 0020D1E5 LDRB R2,[R1, #+0]
\ 00000018 000052E3 CMP R2,#+0
\ 0000001C 0200000A BEQ ??Str_Len_1
147 len++;
\ 00000020 010090E2 ADDS R0,R0,#+1
148 pstr++;
\ 00000024 011091E2 ADDS R1,R1,#+1
\ 00000028 F7FFFFEA B ??Str_Len_0
149 }
150
151 return (len);
\ ??Str_Len_1:
\ 0000002C 0EF0A0E1 MOV PC,LR ;; return
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -