annotate docs/ccguide/chap1.chapter @ 617:fd2cb29abee5

Chapter 2 finished
author roug
date Sat, 30 Nov 2002 09:44:49 +0000
parents b8ed2006640e
children befc3fed07e5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
1 <chapter>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
2 <title>The C Compiler System</title>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
3
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
4 <section>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
5 <title>Introduction</title>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
6 <para>
468
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
7 The "C" programming language is rapidly growing in popularity
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
8 and seems destined to become one of the most popular programming
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
9 languages used for microcomputers. The rapid rise in the use of C
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
10 is not surprising. C is an incredibly versatile and efficient
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
11 language that can handle tasks that previously would have required
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
12 complex assembly language programming.
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
13 </para>
530
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
14 <para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
15 C was originally developed at Bell Telephone Laboratories as an
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
16 implementation language for the UNIX operating system by Brian
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
17 Kernighan and Dennis Ritchie. They also wrote a book titled <quote>The
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
18 C Programming Language</quote> which is universally accepted as the standard
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
19 for the language. It is an interesting reflection on the language
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
20 that although no formal industry-wide <quote>standard</quote> was ever developed
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
21 for C, programs written in C tend to be far more portable between
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
22 radically different computer systems as compared to so-called
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
23 <quote>standardized</quote> languages such as BASIC, COBOL, and PASCAL. The
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
24 reason C is so portable is that the language is so inherently
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
25 expandable that is some special function is required, the user can
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
26 create a portable extension to the language, as opposed to the
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
27 common practice of adding additional statements to the language.
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
28 For example, the number of special-purpose BASIC dialects defies all
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
29 reason. A lesser factor is the underlying UNIX operating system,
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
30 which is also sufficiently versatile to discourage bastardization of
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
31 the language. Indeed, standard C compilers and Unix are intimately
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
32 related.
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
33 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
34 <para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
35 Fortunately, the 6809 microprocessor, the OS-9 operating
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
36 system, and the C language form an outstanding combination. The
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
37 6809 was specifically designed to efficiently run high-level
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
38 languages, and its stack-oriented instruction set and versatile
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
39 repertoire of addressing modes handle the C language very well. As
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
40 mentioned previously, UNIX and C are closely related, and because
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
41 OS-9 is derived from UNIX, it also supports C to the degree that
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
42 almost any application written in C can be transported from a UNIX
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
43 system to an OS-9 system, recompiled, and correctly executed.
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
44 </para>
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
45 </section>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
46 <section>
468
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
47 <title>The Language Implementation</title>
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
48 <para>
468
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
49 OS-9 C is implemented almost exactly as described in 'The C
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
50 Programming Language' by Kernighan and Ritchie (hereafter referred
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
51 to as K&amp;R).
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
52 </para>
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
53 <para>
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
54 Allthough this version of C follows the specification faithfully,
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
55 there are some differences. The differences mostly reflect
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
56 parts of C that are obsolete or the constraints imposed by memory
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
57 size limitations.
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
58 </para>
530
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
59 </section>
472
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
60
530
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
61 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
62 <title>Differences from the K &amp; R Specification</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
63 <para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
64 </para>
472
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
65 </section>
530
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
66
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
67 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
68 <title>Enhancements and Extensions</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
69
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
70 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
71 <title>The <quote>Direct</quote> Storage Class</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
72 <para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
73 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
74 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
75
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
76 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
77 <title>Embedded Assembly Language</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
78 <para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
79 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
80 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
81
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
82 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
83 <title>Control Character Escape Sequences</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
84 <para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
85 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
86 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
87 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
88
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
89 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
90 <title>Implementation-dependent Characteristics</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
91 <para>
617
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
92 K &amp; R frequently refer to characteristics of the C language
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
93 whose exact operations depend on the architacture and instruction
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
94 set of the computer actually used. This section contains specific
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
95 information regarding this version of C for the 6809 processor.
530
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
96 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
97
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
98 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
99 <title>Data Representation and Storage Requirements</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
100 <para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
101 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
102 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
103
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
104 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
105 <title>Register Variables</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
106 <para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
107 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
108 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
109
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
110 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
111 <title>Access To Command Line Parameters</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
112 <para>
609
b8ed2006640e Finished all the error messages in appendix A
roug
parents: 530
diff changeset
113 The standard C arguments "argc" and "argv" are available to
b8ed2006640e Finished all the error messages in appendix A
roug
parents: 530
diff changeset
114 "main" as described in K &amp; R page 110. The start-up routine for C
b8ed2006640e Finished all the error messages in appendix A
roug
parents: 530
diff changeset
115 programs ensures that the parameter string passed to it by the
b8ed2006640e Finished all the error messages in appendix A
roug
parents: 530
diff changeset
116 parent process is converted into null-terminated strings as expected
b8ed2006640e Finished all the error messages in appendix A
roug
parents: 530
diff changeset
117 by the program. In addition, it will run together as a single
b8ed2006640e Finished all the error messages in appendix A
roug
parents: 530
diff changeset
118 argument any strings enclosed between single or double quotes ("'" or '"').
b8ed2006640e Finished all the error messages in appendix A
roug
parents: 530
diff changeset
119 If either is part of the string required, then the other
b8ed2006640e Finished all the error messages in appendix A
roug
parents: 530
diff changeset
120 should be used as a delimiter.
530
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
121 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
122 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
123 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
124
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
125 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
126 <title>System Calls and the Standard Library</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
127
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
128 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
129 <title>Operating System Calls</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
130 <para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
131 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
132 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
133
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
134 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
135 <title>The Standard Library</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
136 <para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
137 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
138 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
139 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
140
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
141 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
142 <title>Run-time Arithmetic Error Handling</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
143 <para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
144 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
145 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
146
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
147 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
148 <title>Achieving Maximum Program Performance</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
149
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
150 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
151 <title>Programming Considerations</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
152 <para>
617
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
153 Because the 6809 is an 8/16 bit microprocessor, the compiler
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
154 can generate efficient code for 8 and 16 bit objects (CHARs, INTs,
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
155 etc.). However, code for 32 and 64 bit values (LONGs, FLOATs,
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
156 DOUBLEs) can be at least four times longer and slower. Therefore
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
157 don't use LONG, FLOAT, or DOUBLE where INT or UNSIGNED will do.
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
158 </para>
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
159 <para>
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
160 The compiler can perform extensive evaluation of constant
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
161 expressions provided they involve only constants of type CHAR, INT,
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
162 and UNSIGNED. There is no constant expression evaluation at
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
163 compile-time (except single constants and "casts" of them) where
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
164 there are constants of type LONG, FLOAT, or DOUBLE, therefore,
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
165 complex constant expressions involving these types are evaluated at
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
166 run time by the compiled program. You should manually compute the
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
167 value of constant expressions of these types if speed is essential.
530
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
168 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
169 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
170
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
171 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
172 <title>The Optimizer Pass</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
173 <para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
174 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
175 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
176
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
177 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
178 <title>The Profiler</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
179 <para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
180 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
181 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
182 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
183
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
184 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
185 <title>C Compiler Component Files and File Usage</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
186 <para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
187 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
188
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
189 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
190 <title>Temporary Files</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
191 <para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
192 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
193 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
194 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
195
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
196 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
197 <title>Running the Compiler</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
198 <para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
199 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
200 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
201
472
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
202 <section>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
203 <title>Compiler Option Flags</title>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
204 <para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
205 The compiler recognizes several command-line option flags which
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
206 modify the compilation process where needed. All flags are
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
207 recognized before compilation commences so the flags may be placed
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
208 anywhere on the command line. Flags may be ran together as in "-ro",
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
209 except where a flag is followed by something else; see "-f=" and
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
210 "-d" for examples.
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
211 </para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
212 <para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
213 -A
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
214 suppresses assembly, leaving the output as assembler code in a
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
215 file whose name is postfixed ".a".
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
216 </para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
217 <para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
218 -E=&lt;number&gt;
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
219 Set the edition number constant byte to the number given. This is
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
220 an OS-9 convention for memory modules.
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
221 </para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
222 <para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
223 -O
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
224 inhibits the assembly code optimizer pass. The optimizer will
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
225 shorten object code by about 11% with a comparable increase in speed
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
226 and is recommended for production versions of de-bugged programs.
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
227 </para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
228 <para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
229 -P
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
230 invokes the profiler to generate function frequency
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
231 statistics after program execution.
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
232 </para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
233 <para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
234 -R
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
235 suppresses linking library modules into an executable program.
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
236 Outputs are left in files with postfixes ".r".
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
237 </para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
238 <para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
239 -M=&lt;memory size&gt;
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
240 will instruct the linker to allocate &lt;memory size&gt;
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
241 for data, stack, and parameter area. Memory size may be expressed
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
242 in pages (an integer) or in kilobytes by appending "k" to an
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
243 integer. For more details of the use of this option, see the
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
244 "Memory Management" section of this manual.
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
245 </para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
246 <para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
247 -L=&lt;filename&gt;
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
248 specifies a library to be searched by the linker
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
249 before the Standard Library and system interface.
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
250 </para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
251 <para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
252 -F=&lt;path&gt;
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
253 overrides the above output file naming. The output file
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
254 will be left with &lt;filename&gt; as its name. This flag does not make
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
255 sense in multiple source mode, and either the -a or -r flag is also
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
256 present. The module will be called the last name in &lt;path&gt;.
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
257 </para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
258 <para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
259 -C
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
260 will output the source code as comments with the assembler code.
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
261 </para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
262 <para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
263 -S
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
264 stops the generation of stack-checking code. -S should only be
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
265 used with great care when the appication is extremely time-critical
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
266 and when the use of the stack by compiler generated code is fully
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
267 understood.
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
268 </para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
269 <para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
270 -D&lt;identifier&gt;
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
271 is equivalent to "#define &lt;identifier&gt;" written in
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
272 the source file. -D is useful where different versions of a program
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
273 are maintained in one source file and differentiated by means of the
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
274 "#ifdef" of "#ifndef" pre-processor directives. If the &lt;identifier&gt;
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
275 is used as a macro for expansion by the pre-processor, "1"(one) will
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
276 be the expanded "value" unless the form "-d&lt;identifier&gt;=&lt;string&gt;" is
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
277 used in which case the expansion will be &lt;string&gt;.
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
278 </para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
279 <table frame="none">
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
280 <title>Command Line and Option Flag Examples</title>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
281 <tgroup cols="3">
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
282 <colspec colwidth="1.5in" colname="c1">
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
283 <colspec colwidth="1.5in" colname="c2">
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
284 <colspec colwidth="1.5in" colname="c3">
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
285 <thead>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
286 <row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
287 <entry>command line</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
288 <entry>action</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
289 <entry>output file(s)</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
290 </row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
291 </thead>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
292 <tbody>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
293 <row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
294 <entry>cc prg.c</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
295 <entry>compile to an executable program</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
296 <entry>prg</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
297 <entry></entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
298 </row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
299 <row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
300 <entry>cc prg.c -a</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
301 <entry>compile to assembly language source code</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
302 <entry>prg.a</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
303 </row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
304 <row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
305 <entry>cc prg.c -r</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
306 <entry>compile to relocatable module</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
307 <entry>prg.r</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
308 </row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
309 <row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
310 <entry>cc prg1.c prg2.c prg3.c</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
311 <entry>compile to executable program</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
312 <entry>prg1.r, prg2.r, prg3.r, output</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
313 </row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
314 <row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
315 <entry>cc prg1.c prg2.a prg3.r</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
316 <entry>compile prg1.c, assemble prg2.a and combine all into
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
317 and executable program</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
318 <entry>prg1.r, prg2.r</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
319 </row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
320 <row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
321 <entry>cc prg1.c prg2.c -a</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
322 <entry>compile to assembly language source code</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
323 <entry>prg1.a, prg2.a</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
324 </row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
325 <row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
326 <entry>cc prg1.c prg2.c -f=prg</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
327 <entry>compile to executable program</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
328 <entry>prg</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
329 </row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
330 </tbody>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
331 </tgroup>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
332 </table>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
333
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
334 </section>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
335 </chapter>