📄 dhry_2.lst
字号:
##############################################################################
# #
# IAR ARM ANSI C/EC++ Compiler V3.10A/W32 05/Nov/2001 14:58:27 #
# Copyright 1999-2001 IAR Systems. All rights reserved. #
# #
# Cpu mode = arm #
# Code model = small #
# Endian = little #
# Source file = C:\At91\software\projects\bench\Source\dhry_2.c #
# Command line = -I C:\Compil\EW23\ARM\INC\ -I ../../..\ -lcN #
# C:\At91\software\projects\bench\IAR\ARM_INT\List\ -la #
# C:\At91\software\projects\bench\IAR\ARM_INT\List\ -o #
# C:\At91\software\projects\bench\IAR\ARM_INT\Obj\ -e #
# -s9 --debug --cpu_mode arm --code_model small --endian #
# little --cpu=arm7tdmi C:\At91\software\projects\bench\S #
# ource\dhry_2.c #
# List file = C:\At91\software\projects\bench\IAR\ARM_INT\List\dhry_2 #
# .lst #
# Object file = C:\At91\software\projects\bench\IAR\ARM_INT\Obj\dhry_2. #
# r79 #
# #
# #
##############################################################################
C:\At91\software\projects\bench\Source\dhry_2.c
1 /*
2 ****************************************************************************
3 *
4 * "DHRYSTONE" Benchmark Program
5 * -----------------------------
6 *
7 * Version: C, Version 2.1
8 *
9 * File: dhry_2.c (part 3 of 3)
10 *
11 * Date: May 25, 1988
12 *
13 * Author: Reinhold P. Weicker
14 *
15 ****************************************************************************
16 */
17
18 #include "dhry.h"
19 #include <string.h>
20
21 #ifndef REG
22 #define REG
23 /* REG becomes defined as empty */
24 /* i.e. no register variables */
25 #endif
26
27 extern int Int_Glob;
28 extern char Ch_1_Glob;
29
30 Boolean Func_3 (Enumeration Enum_Par_Val)
31 /***************************/
32 /* executed once */
33 /* Enum_Par_Val == Ident_3 */
34 {
35 Enumeration Enum_Loc;
36
37 Enum_Loc = Enum_Par_Val;
38 if (Enum_Loc == Ident_3)
39 return (true);
40 else /* not executed */
41 return (false);
42 } /* Func_3 */
43
44 void Proc_6 ( Enumeration Enum_Val_Par, Enumeration *Enum_Ref_Par)
45 /*********************************/
46 /* executed once */
47 /* Enum_Val_Par == Ident_3, Enum_Ref_Par becomes Ident_2 */
48 {
49 *Enum_Ref_Par = Enum_Val_Par;
50 if (! Func_3 (Enum_Val_Par))
51 /* then, not executed */
52 *Enum_Ref_Par = Ident_4;
53 switch (Enum_Val_Par)
54 {
55 case Ident_1:
56 *Enum_Ref_Par = Ident_1;
57 break;
58 case Ident_2:
59 if (Int_Glob > 100)
60 *Enum_Ref_Par = Ident_1;
61 else
62 *Enum_Ref_Par = Ident_4;
63 break;
64 case Ident_3: /* executed */
65 *Enum_Ref_Par = Ident_2;
66 break;
67 case Ident_4:
68 break;
69 case Ident_5:
70 *Enum_Ref_Par = Ident_3;
71 break;
72 } /* switch */
73 } /* Proc_6 */
74
75
76 void Proc_7 ( One_Fifty Int_1_Par_Val,
77 One_Fifty Int_2_Par_Val,
78 One_Fifty *Int_Par_Ref )
79 /**********************************************/
80 /* executed three times */
81 /* first call: Int_1_Par_Val == 2, Int_2_Par_Val == 3, */
82 /* Int_Par_Ref becomes 7 */
83 /* second call: Int_1_Par_Val == 10, Int_2_Par_Val == 5, */
84 /* Int_Par_Ref becomes 17 */
85 /* third call: Int_1_Par_Val == 6, Int_2_Par_Val == 10, */
86 /* Int_Par_Ref becomes 18 */
87 {
88 One_Fifty Int_Loc;
89
90 Int_Loc = Int_1_Par_Val + 2;
91 *Int_Par_Ref = Int_2_Par_Val + Int_Loc;
92 } /* Proc_7 */
93
94
95 void Proc_8 ( Arr_1_Dim Arr_1_Par_Ref,
96 Arr_2_Dim Arr_2_Par_Ref,
97 int Int_1_Par_Val,
98 int Int_2_Par_Val)
99 /*********************************************************************/
100 /* executed once */
101 /* Int_Par_Val_1 == 3 */
102 /* Int_Par_Val_2 == 7 */
103 {
104 REG One_Fifty Int_Index;
105 REG One_Fifty Int_Loc;
106
107 Int_Loc = Int_1_Par_Val + 5;
108 Arr_1_Par_Ref [Int_Loc] = Int_2_Par_Val;
109 Arr_1_Par_Ref [Int_Loc+1] = Arr_1_Par_Ref [Int_Loc];
110 Arr_1_Par_Ref [Int_Loc+30] = Int_Loc;
111 for (Int_Index = Int_Loc; Int_Index <= Int_Loc+1; ++Int_Index)
112 Arr_2_Par_Ref [Int_Loc] [Int_Index] = Int_Loc;
113 Arr_2_Par_Ref [Int_Loc] [Int_Loc-1] += 1;
114 Arr_2_Par_Ref [Int_Loc+20] [Int_Loc] = Arr_1_Par_Ref [Int_Loc];
115 Int_Glob = 5;
116 } /* Proc_8 */
117
118
119 Enumeration Func_1 (Capital_Letter Ch_1_Par_Val, Capital_Letter Ch_2_Par_Val)
120 /*************************************************/
121 /* executed three times */
122 /* first call: Ch_1_Par_Val == 'H', Ch_2_Par_Val == 'R' */
123 /* second call: Ch_1_Par_Val == 'A', Ch_2_Par_Val == 'C' */
124 /* third call: Ch_1_Par_Val == 'B', Ch_2_Par_Val == 'C' */
125 {
126 Capital_Letter Ch_1_Loc;
127 Capital_Letter Ch_2_Loc;
128
129 Ch_1_Loc = Ch_1_Par_Val;
130 Ch_2_Loc = Ch_1_Loc;
131 if (Ch_2_Loc != Ch_2_Par_Val)
132 /* then, executed */
133 return (Ident_1);
134 else /* not executed */
135 {
136 Ch_1_Glob = Ch_1_Loc;
137 return (Ident_2);
138 }
139 } /* Func_1 */
140
141
142 Boolean Func_2 (Str_30 Str_1_Par_Ref, Str_30 Str_2_Par_Ref)
143 /*************************************************/
144 /* executed once */
145 /* Str_1_Par_Ref == "DHRYSTONE PROGRAM, 1'ST STRING" */
146 /* Str_2_Par_Ref == "DHRYSTONE PROGRAM, 2'ND STRING" */
147
148 {
149 REG One_Thirty Int_Loc;
150 Capital_Letter Ch_Loc;
151
152 Int_Loc = 2;
153 while (Int_Loc <= 2) /* loop body executed once */
154 if (Func_1 (Str_1_Par_Ref[Int_Loc],
155 Str_2_Par_Ref[Int_Loc+1]) == Ident_1)
156 /* then, executed */
157 {
158 Ch_Loc = 'A';
159 Int_Loc += 1;
160 } /* if, while */
161
162 if (Ch_Loc >= 'W' && Ch_Loc < 'Z')
163 /* then, not executed */
164 Int_Loc = 7;
165 if (Ch_Loc == 'R')
166 /* then, not executed */
167 return (true);
168 else /* executed */
169 {
170 if (strcmp (Str_1_Par_Ref, Str_2_Par_Ref) > 0)
171 /* then, not executed */
172 {
173 Int_Loc += 7;
174 Int_Glob = Int_Loc;
175 return (true);
176 }
177 else /* executed */
178 return (false);
179 } /* if Ch_Loc */
180 } /* Func_2 */
181
182
183
Maximum stack usage in bytes:
Function CSTACK
-------- ------
Func_1 0
Func_2 8
Func_3 0
Proc_6 4
Proc_7 0
Proc_8 16
500 bytes in segment NEARFUNC_A
500 bytes of CODE memory
Errors: none
Warnings: none
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -