annotate docs/ccguide/chap1.chapter @ 992:1b5656126ac6

Use <errorcode> where appropiate
author roug
date Sun, 23 Feb 2003 14:53:55 +0000
parents a4a6b6315146
children
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>
629
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
63 <itemizedlist spacing="compact">
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
64 <listitem><para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
65 Bit fields are not supported.
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
66 </para></listitem>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
67 <listitem><para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
68 Constant expressions for initializers may include arithmetic
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
69 operators only if all the operands are of type INT or CHAR.
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
70 </para></listitem>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
71 <listitem><para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
72 The older forms of assignment operators, '=+' or '=*', which
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
73 are recognized by some C compilers, are not supported. You
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
74 must use the newer forms '+=','*=' etc.
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
75 </para></listitem>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
76 <listitem><para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
77 "#ifdef (or #ifndef) ...[#else...] #endif" is supported but
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
78 "#if &lt;constant expression&gt;" is not.
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
79 </para></listitem>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
80 <listitem><para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
81 It is not possible to extend macro definitions or strings
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
82 over more than one line of source code.
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
83 </para></listitem>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
84 <listitem><para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
85 The escape sequence for new-line '\n' refers to the ASCII
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
86 carriage return character (used by OS-9 for end-of-line), not
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
87 linefeed. (hex 0A). Programs which use '\n' for end-of-line
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
88 (which includes all programs in K &amp; R), will still work
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
89 properly.
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
90 </para></listitem>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
91 </itemizedlist>
472
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
92 </section>
530
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
93
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
94 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
95 <title>Enhancements and Extensions</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
96
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
97 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
98 <title>The <quote>Direct</quote> Storage Class</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
99 <para>
629
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
100 The 6809 microprocessor instructions for accessing memory via
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
101 an index register or the stack pointer can be relatively short and
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
102 fast when they are used in C programs to access "auto" (function
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
103 local) variables or function arguments. The instructions for
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
104 accessing global variables are normally not so nice and must be four
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
105 bytes long and correspondingly slow. However, the 6809 has a nice
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
106 feature which helps considerably. Memory, anywhere in a single page
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
107 (256 byte block), may be accessed with fast, two byte instructions.
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
108 This is called the "direct page", and at any time its location is
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
109 specified by the contents of the "direct page register" within the
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
110 processor. The linkage editor sorts out where this could be, and
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
111 it need not concern the programmer, who only needs to specify for
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
112 the compiler which variables should be in the direct page to give
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
113 the maximum benefit in code size and execution speed.
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
114 </para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
115 <para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
116 To this end, a new storage class specifier is recognized by the
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
117 compiler. In the manner of K &amp; R page 192, the sc-specifier list
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
118 is extended as follows:
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
119 <informaltable frame="none">
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
120 <tgroup cols="3">
633
14e792902588 Convert to Docbook XML format
roug
parents: 631
diff changeset
121 <colspec colwidth="1.0in"/>
14e792902588 Convert to Docbook XML format
roug
parents: 631
diff changeset
122 <colspec colwidth="1.0in"/>
14e792902588 Convert to Docbook XML format
roug
parents: 631
diff changeset
123 <colspec colwidth="1.0in"/>
629
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
124 <tbody>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
125 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
126 <entry>Sc-specifier:</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
127 <entry>auto</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
128 <entry></entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
129 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
130 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
131 <entry></entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
132 <entry>static</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
133 <entry></entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
134 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
135 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
136 <entry></entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
137 <entry>extern</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
138 <entry></entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
139 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
140 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
141 <entry></entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
142 <entry>register</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
143 <entry></entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
144 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
145 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
146 <entry></entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
147 <entry>typedef</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
148 <entry></entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
149 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
150 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
151 <entry></entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
152 <entry>direct</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
153 <entry>(extension)</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
154 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
155 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
156 <entry></entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
157 <entry>extern direct</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
158 <entry>(extension)</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
159 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
160 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
161 <entry></entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
162 <entry>static direct</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
163 <entry>(extension)</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
164 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
165 </tbody>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
166 </tgroup>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
167 </informaltable>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
168 The new key word may be used in place of one of the other sc-specifiers,
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
169 and its effect is that the variable will be placed in
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
170 the direct page. "DIRECT" creates a global direct page variable.
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
171 "EXTERN DIRECT" references an EXTERNAL-type direct page variable;
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
172 and "STATIC DIRECT" creates a local direct page variable. These new
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
173 classed may not be used to declare function arguments. "Direct"
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
174 variables can be initialized but will, as with other variables not
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
175 explicitly initialized, have the value zero at the start of program
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
176 execution. 255 bytes are available in the direct page (the linker
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
177 requires one byte). If all the direct variables occupy less than the
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
178 full 255 bytes, the remaining global variables will occupy the
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
179 balance and memory above if necesary. If too many bytes or storage
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
180 are requested in the direct page, the linkage editor will report an
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
181 error, and the programmer will have to reduce the use of DIRECT-type
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
182 variables to fit the 256 bytes addressable by the 6809.
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
183 </para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
184 <para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
185 It should be kept in mind that "direct" is unique to this
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
186 compiler, and it may not be possible to transport programs written
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
187 using "direct" to other environments without modification.
530
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
188 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
189 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
190
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
191 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
192 <title>Embedded Assembly Language</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
193 <para>
629
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
194 As versatile as C is, occasionally there are some things that
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
195 can only be done (or done at maximum speed) in assembly language.
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
196 The OS-9 C compiler permits user-supplied assebly-language
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
197 statements to be directly embedded in C source programs.
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
198 </para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
199 <para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
200 A line beginning with "#asm" switches the compiler into a mode
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
201 which passes all subsequent lines directly to the assembly-language
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
202 output, until a line beginning with "#endasm" is encountered.
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
203 "#endasm" switches the mode back to normal. Care should be
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
204 exercised when using this directive so that the correct code section
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
205 is adhered to. Normal code from the compiler is in the PSECT (code)
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
206 section. If your assembly code uses the VSECT (variable) section,
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
207 be sure to put a ENDSECT directive at the end to leave the state
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
208 correct for following compiler generated code.
530
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
209 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
210 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
211
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
212 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
213 <title>Control Character Escape Sequences</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
214 <para>
629
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
215 The escape sequences for non-printing characters in character
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
216 constants and strings (see K &amp; R page 181) are extended as follows:
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
217 <programlisting>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
218 linefeed (LF): \l (lower case 'ell')
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
219 </programlisting>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
220 This is to distinguish LF (hex 0A) from \n which on OS-9 is the same
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
221 as \r (hex 0D).
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
222 <programlisting>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
223 bit patterns: \NNN (octal constant)
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
224 \dNNN (decimal constant)
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
225 \xNN (hexadecimal constant)
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
226 </programlisting>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
227 For example, the following all have a value of 255 (decimal):
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
228 <programlisting>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
229 \377 \xff \d255
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
230 </programlisting>
530
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
231 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
232 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
233 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
234
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
235 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
236 <title>Implementation-dependent Characteristics</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
237 <para>
617
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
238 K &amp; R frequently refer to characteristics of the C language
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
239 whose exact operations depend on the architacture and instruction
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
240 set of the computer actually used. This section contains specific
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
241 information regarding this version of C for the 6809 processor.
530
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
242 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
243
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
244 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
245 <title>Data Representation and Storage Requirements</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
246 <para>
629
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
247 Each variable type requires a specific amount of memory for
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
248 storage. The sizes of the basic types in bytes are as follows:
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
249 </para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
250 <informaltable frame="none">
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
251 <tgroup cols="3">
633
14e792902588 Convert to Docbook XML format
roug
parents: 631
diff changeset
252 <colspec colwidth="0.8in"/>
14e792902588 Convert to Docbook XML format
roug
parents: 631
diff changeset
253 <colspec colwidth="0.4in"/>
14e792902588 Convert to Docbook XML format
roug
parents: 631
diff changeset
254 <colspec colwidth="3.0in"/>
629
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
255 <thead>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
256 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
257 <entry>Data Type</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
258 <entry>Size</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
259 <entry>Internal Representation</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
260 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
261 </thead>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
262 <tbody>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
263 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
264 <entry>CHAR</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
265 <entry>1</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
266 <entry>two's complement binary</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
267 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
268 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
269 <entry>INT</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
270 <entry>2</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
271 <entry>two's complement binary</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
272 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
273 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
274 <entry>UNSIGNED</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
275 <entry>2</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
276 <entry>unsigned binary</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
277 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
278 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
279 <entry>LONG</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
280 <entry>4</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
281 <entry>two's complement binary</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
282 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
283 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
284 <entry>FLOAT</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
285 <entry>4</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
286 <entry>binary floating point (see below)</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
287 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
288 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
289 <entry>DOUBLE</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
290 <entry>8</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
291 <entry>binary floating point (see below)</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
292 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
293 </tbody>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
294 </tgroup>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
295 </informaltable>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
296 <para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
297 This compiler follows the PDP-1 implementation and format in
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
298 that CHARs are converted to INTs by sign extension, "SHORT" or
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
299 "SHORT INT" means INT, "LONG INT" means LONG and "LONG FLOAT" means
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
300 DOUBLE. The format for DOUBLE values is as follows:
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
301 </para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
302 <screen>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
303 (low byte) (high byte)
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
304 +-+---------------------------------------+----------+
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
305 ! ! seven byte ! !
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
306 ! ! mantissa ! !
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
307 +-+---------------------------------------+----------+
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
308 ^ sign bit
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
309 </screen>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
310 <para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
311 The for of the mantissa is sign and magnitude with an implied
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
312 "1" bit at the sign bit position. The exponent is biased by 128.
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
313 The format of a FLOAT is identical, except that the mantissa is only
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
314 three bytes long. Conversion from DOUBLE to FLOAT is carried out by
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
315 truncating the least significant (right-most) four bytes of the
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
316 mantissa. The reverse conversion is done by padding the least
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
317 significant four mantissa bytes with zeros.
530
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
318 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
319 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
320
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
321 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
322 <title>Register Variables</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
323 <para>
629
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
324 One register variable may be declared in each function. The
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
325 only types permitted for register variables are int, unsigned and
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
326 pointer. Invalid register variable declarations are ignored; i.e.
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
327 the storage class is made auto. For further details see K &amp; R page 81.
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
328 </para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
329 <para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
330 A considerable saving in code size and speed can be made by
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
331 judicious use of a register variable. The most efficient use is
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
332 made of it for a pointer or a counter for a loop. However, if a
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
333 register variable is used for a complex arithmetic expression, there
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
334 is no saving. The "U" register is assigned to register variables.
530
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
335 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
336 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
337
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
338 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
339 <title>Access To Command Line Parameters</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
340 <para>
609
b8ed2006640e Finished all the error messages in appendix A
roug
parents: 530
diff changeset
341 The standard C arguments "argc" and "argv" are available to
b8ed2006640e Finished all the error messages in appendix A
roug
parents: 530
diff changeset
342 "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
343 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
344 parent process is converted into null-terminated strings as expected
b8ed2006640e Finished all the error messages in appendix A
roug
parents: 530
diff changeset
345 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
346 argument any strings enclosed between single or double quotes ("'" or '"').
b8ed2006640e Finished all the error messages in appendix A
roug
parents: 530
diff changeset
347 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
348 should be used as a delimiter.
530
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
349 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
350 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
351 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
352
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
353 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
354 <title>System Calls and the Standard Library</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
355
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
356 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
357 <title>Operating System Calls</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
358 <para>
629
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
359 The system interface supports almost all the system calls of
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
360 both OS-9 and UNIX. In order to facilitate the portability of
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
361 programs from UNIX, some of the calls use UNIX names rather than
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
362 OS-9 names for the same function. There are a few UNIX calls that
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
363 do not have exactly equivalent OS-9 calls. In these cases, the
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
364 library function simulates the function of the corresponding UNIX
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
365 call. In cases where there are OS-9 calls that do not have UNIX
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
366 equivalents, the OS-9 names are used. Details of the calls and a
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
367 name cross-reference are provided in the "C System Calls" section of
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
368 this manual.
530
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
369 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
370 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
371
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
372 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
373 <title>The Standard Library</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
374 <para>
629
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
375 The C compiler includes a very complete library of standard
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
376 functions. It is essential for any program which uses functions
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
377 from the standard library to have the statement:
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
378 <programlisting>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
379 "#include &lt;stdio.h&gt;
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
380 </programlisting>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
381 See the "C Standard Library" section of this manual for details on
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
382 the standard library functions provided.
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
383 </para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
384 <para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
385 IMPORTANT NOTE: If output via printf(), fprintf() or sprintf() of
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
386 long integers is required, the program MUST call "pflinit()" at some
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
387 point; this is necessary so that programs not involving LONGS do not
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
388 have the extra LONGs output code appended. Similarly, if FLOATs or
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
389 DOUBLEs are to be printed, "pffinit()" MUST be called. These functions
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
390 do nothing; existence of calls to them in a program informs
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
391 the linker that the relevant routines are also needed.
530
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
392 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
393 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
394 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
395
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
396 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
397 <title>Run-time Arithmetic Error Handling</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
398 <para>
629
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
399 K &amp; R leave the treatment of various arithmetic errors open,
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
400 merely saying that it is machine dependent. This implementation
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
401 deal with a limited number of error conditions in a special way; it
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
402 should be assumed that the results of other possible errors are
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
403 undefined.
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
404 </para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
405 <para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
406 Three new system error numbers are defined in &lt;errno.h&gt;:
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
407 <programlisting>
655
a4a6b6315146 Completely finished
roug
parents: 633
diff changeset
408 #define EFPOVR 40 /* floating point overflow of underflow */
a4a6b6315146 Completely finished
roug
parents: 633
diff changeset
409 #define EDIVERR 41 /* division by zero */
a4a6b6315146 Completely finished
roug
parents: 633
diff changeset
410 #define EINTERR 42 /* overflow on conversion of floating point
a4a6b6315146 Completely finished
roug
parents: 633
diff changeset
411 to long integer */
629
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
412 </programlisting>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
413 </para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
414 <para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
415 If one of these conditions occur, the program will send a
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
416 signal to itself with the value of one of these errors. If not
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
417 caught or ignored, the will cause termination of program with
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
418 an error return to the parent process. However, the program can
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
419 catch the interrupt using "signal()" or "intercept()" (see C System
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
420 Calls), and in this case the service routine has the error number as
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
421 its argument.
530
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
422 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
423 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
424
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
425 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
426 <title>Achieving Maximum Program Performance</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
427
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
428 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
429 <title>Programming Considerations</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
430 <para>
617
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
431 Because the 6809 is an 8/16 bit microprocessor, the compiler
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
432 can generate efficient code for 8 and 16 bit objects (CHARs, INTs,
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
433 etc.). However, code for 32 and 64 bit values (LONGs, FLOATs,
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
434 DOUBLEs) can be at least four times longer and slower. Therefore
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
435 don't use LONG, FLOAT, or DOUBLE where INT or UNSIGNED will do.
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
436 </para>
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
437 <para>
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
438 The compiler can perform extensive evaluation of constant
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
439 expressions provided they involve only constants of type CHAR, INT,
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
440 and UNSIGNED. There is no constant expression evaluation at
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
441 compile-time (except single constants and "casts" of them) where
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
442 there are constants of type LONG, FLOAT, or DOUBLE, therefore,
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
443 complex constant expressions involving these types are evaluated at
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
444 run time by the compiled program. You should manually compute the
fd2cb29abee5 Chapter 2 finished
roug
parents: 609
diff changeset
445 value of constant expressions of these types if speed is essential.
530
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
446 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
447 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
448
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
449 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
450 <title>The Optimizer Pass</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
451 <para>
629
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
452 The optimizer pass automatically occurs after the compilation
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
453 passes. It reads the assembler source code text and removes
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
454 redundant code and searches for code sequences that can be replaced
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
455 by shorter and faster equivalents. The optimizer will shorten object
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
456 code by about 11% with a significant increase in program execution
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
457 speed. The optimizer is recommended for production versions of
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
458 debugged programs. Because this pass takes additional time, the "-O"
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
459 compiler option can be used to inhibit it during error-checking-only
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
460 compilations.
530
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
461 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
462 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
463
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
464 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
465 <title>The Profiler</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
466 <para>
629
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
467 The profiler is an optional method used to determine the
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
468 frequency of execution of each function in a C program. It allows
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
469 you to identify the most-frequently used functions where algorithmic
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
470 or C source code programming improvements will yield the greatest
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
471 gains.
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
472 </para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
473 <para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
474 When the "-P" compiler option is selected, code is generated at
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
475 the beginning of each function to call the profiler module (called
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
476 "_prof"), which counts invocations of each function during program
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
477 execution. When the program has terminated, the profiler
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
478 automatically prints a list of all functions and the number of times
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
479 each was called. The profiler slightly reduces program execution
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
480 speed. See "prof.c" source for more information.
530
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
481 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
482 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
483 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
484
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
485 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
486 <title>C Compiler Component Files and File Usage</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
487 <para>
629
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
488 Compilation of a C program by cc requires that the following
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
489 files be present in the current execution directory (CMDS).
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
490 </para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
491
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
492 <table frame="none">
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
493 <title>OS-9 Level I Systems</title>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
494 <tgroup cols="2">
633
14e792902588 Convert to Docbook XML format
roug
parents: 631
diff changeset
495 <colspec colwidth="1.0in"/>
14e792902588 Convert to Docbook XML format
roug
parents: 631
diff changeset
496 <colspec colwidth="3.0in"/>
629
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
497 <tbody>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
498 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
499 <entry>cc1</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
500 <entry>compiler executive program</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
501 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
502 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
503 <entry>c.prep</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
504 <entry>macro pre-processor</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
505 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
506 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
507 <entry>c.pass1</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
508 <entry>compiler pass 1</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
509 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
510 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
511 <entry>c.pass2</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
512 <entry>compiler pass 2</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
513 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
514 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
515 <entry>c.opt</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
516 <entry>assembly code optimizer</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
517 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
518 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
519 <entry>c.asm</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
520 <entry>relocating assembler</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
521 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
522 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
523 <entry>c.link</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
524 <entry>linkage editor</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
525 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
526 </tbody>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
527 </tgroup>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
528 </table>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
529
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
530
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
531 <table frame="none">
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
532 <title>OS-9 Level II Systems</title>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
533 <tgroup cols="2">
633
14e792902588 Convert to Docbook XML format
roug
parents: 631
diff changeset
534 <colspec colwidth="1.0in"/>
14e792902588 Convert to Docbook XML format
roug
parents: 631
diff changeset
535 <colspec colwidth="3.0in"/>
629
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
536 <tbody>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
537 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
538 <entry>cc2</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
539 <entry>compiler executive program</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
540 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
541 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
542 <entry>c.prep</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
543 <entry>macro pre-processor</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
544 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
545 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
546 <entry>c.comp</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
547 <entry>compiler proper</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
548 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
549 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
550 <entry>c.opt</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
551 <entry>assembly code optimizer</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
552 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
553 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
554 <entry>c.asm</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
555 <entry>relocating assembler</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
556 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
557 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
558 <entry>c.link</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
559 <entry>linkage editor</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
560 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
561 </tbody>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
562 </tgroup>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
563 </table>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
564 <para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
565 In addition a file called "clib.l" contains the standard library,
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
566 math functions, and systems library. The file "cstart.r" is
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
567 the setup code for compiled programs. Both of these files must be
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
568 located in a directory named "LIB" on the system's default mass
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
569 storage device, which is specified in the OS-9 "INIT" module and is
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
570 usually the disk drive the system is booted from.
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
571 </para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
572 <para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
573 If, when specifying "#include" files for the pre-processor to
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
574 read in, the programmer uses angle brackets, "&lt;" and "&gt;", instead of
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
575 parentheses, the file will be sought starting at the "DEFS"
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
576 directory on whichever drive is the default system drive for the
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
577 system running.
530
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
578 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
579
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
580 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
581 <title>Temporary Files</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
582 <para>
629
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
583 A number of temporary files are created in the current data
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
584 directory during compilation, and it is important to ensure that
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
585 enough space is available on the disk drive. As a rough guide, at
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
586 least three times the number of blocks in the largest source file
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
587 (and its included files) should be free.
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
588 </para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
589 <para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
590 The identifiers "etext", "edata", and "end" are predefined in the
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
591 linkage editor and may be used to establish the addresses of the end
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
592 of executable text, initialized data, and uninitialized data
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
593 respectively.
530
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
594 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
595 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
596 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
597
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
598 <section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
599 <title>Running the Compiler</title>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
600 <para>
992
1b5656126ac6 Use <errorcode> where appropiate
roug
parents: 655
diff changeset
601 The are two commands which invoke distinct versions of the
629
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
602 compiler. "cc1" is for OS-9 Level I which uses a two pass compiler,
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
603 and, "cc2" is for Level II which causes a single pass version. Both
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
604 versions of the compiler works identically, the main difference is
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
605 that cc1 has been divided into two passes to fit the smaller memory
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
606 size of OS-9 Level I systems. In the following text, "cc" refers to
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
607 either "cc1" or "cc2" as appropiate for your system. The syntax of
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
608 the command line which calls the compiler is:
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
609 </para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
610 <cmdsynopsis>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
611 <command>cc</command>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
612 <arg>option-flags</arg>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
613 <arg rep="repeat" choice="plain"><replaceable>file</replaceable></arg>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
614 </cmdsynopsis>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
615 <para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
616 One file at a time can be compiled, or a number of files may be
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
617 compiled together. The compiler manages the compilation up
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
618 to four stages: pre-processor, compilation to assembler code,
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
619 assembly to relocatable code, and linking to binary executable
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
620 code (in OS-9 memory module format).
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
621 </para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
622 <para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
623 The compiler accepts three types of source files, provided each
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
624 name on the command line has the relevant postfix as shown below.
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
625 Any of the above file types may be mixed on the command line.
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
626 </para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
627 <table frame="none">
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
628 <title>File Name Suffix Conventions</title>
631
594a34d027f8 Some progres on the BASIC09 examples
roug
parents: 629
diff changeset
629 <tgroup cols="2">
633
14e792902588 Convert to Docbook XML format
roug
parents: 631
diff changeset
630 <colspec colwidth="0.5in"/>
14e792902588 Convert to Docbook XML format
roug
parents: 631
diff changeset
631 <colspec colwidth="3.0in"/>
629
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
632 <thead>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
633 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
634 <entry>Suffix</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
635 <entry>Usage</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
636 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
637 </thead>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
638 <tbody>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
639 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
640 <entry>.c</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
641 <entry>C source file</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
642 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
643 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
644 <entry>.a</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
645 <entry>assembly language source file</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
646 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
647 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
648 <entry>.r</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
649 <entry>relocatable module</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
650 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
651 <row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
652 <entry>none</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
653 <entry>executable binary (OS-9 memory module)</entry>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
654 </row>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
655 </tbody>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
656 </tgroup>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
657 </table>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
658 <para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
659 There are two modes of operation: multible source file and
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
660 single source file. The compiler selects the mode by inspecting
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
661 the command line. The usual mode is single source and is specified
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
662 by having only one source file name on the command line. Of
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
663 course, more than one source file may be compiled together by using
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
664 the "#include" facility in the source code. In this mode, the
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
665 compiler will use the name obtained by removing the postfix from the
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
666 name supplied on the command line, and the output file (and the
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
667 memory module produced) will have this name. For example:
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
668 <screen>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
669 cc prg.c
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
670 </screen>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
671 will leave an executable file called "prg" in the current execution
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
672 directory.
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
673 </para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
674 <para>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
675 The multiple source mode is specified by having more than one
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
676 source file name on the command line. In this mode, the object code
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
677 output file will have the name "output" in the current execution
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
678 directory, unless a name is given using the "-f=" option (see
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
679 below). Also, in multiple source mode, the relocatable modules
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
680 generated as intermediate files will be left in the same directories
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
681 as their corresponding source files with the postfixes changed to
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
682 ".r". For example:
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
683 <screen>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
684 cc prg1.c /d0/fred/prg2.c
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
685 </screen>
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
686 will leave an executable file called "output" in the current
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
687 execution directory, one file called "prg1.r" in the current data
befc3fed07e5 Chapitre 1 est fini
roug
parents: 617
diff changeset
688 directory, and "prg2.r" in "/d0/fred".
530
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
689 </para>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
690 </section>
c43b678c0055 Mainly section structures added.
roug
parents: 472
diff changeset
691
472
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
692 <section>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
693 <title>Compiler Option Flags</title>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
694 <para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
695 The compiler recognizes several command-line option flags which
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
696 modify the compilation process where needed. All flags are
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
697 recognized before compilation commences so the flags may be placed
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
698 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
699 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
700 "-d" for examples.
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
701 </para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
702 <para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
703 -A
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
704 suppresses assembly, leaving the output as assembler code in a
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
705 file whose name is postfixed ".a".
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
706 </para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
707 <para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
708 -E=&lt;number&gt;
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
709 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
710 an OS-9 convention for memory modules.
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
711 </para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
712 <para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
713 -O
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
714 inhibits the assembly code optimizer pass. The optimizer will
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
715 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
716 and is recommended for production versions of de-bugged programs.
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
717 </para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
718 <para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
719 -P
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
720 invokes the profiler to generate function frequency
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
721 statistics after program execution.
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
722 </para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
723 <para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
724 -R
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
725 suppresses linking library modules into an executable program.
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
726 Outputs are left in files with postfixes ".r".
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
727 </para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
728 <para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
729 -M=&lt;memory size&gt;
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
730 will instruct the linker to allocate &lt;memory size&gt;
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
731 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
732 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
733 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
734 "Memory Management" section of this manual.
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
735 </para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
736 <para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
737 -L=&lt;filename&gt;
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
738 specifies a library to be searched by the linker
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
739 before the Standard Library and system interface.
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
740 </para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
741 <para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
742 -F=&lt;path&gt;
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
743 overrides the above output file naming. The output file
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
744 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
745 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
746 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
747 </para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
748 <para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
749 -C
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
750 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
751 </para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
752 <para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
753 -S
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
754 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
755 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
756 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
757 understood.
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
758 </para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
759 <para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
760 -D&lt;identifier&gt;
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
761 is equivalent to "#define &lt;identifier&gt;" written in
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
762 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
763 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
764 "#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
765 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
766 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
767 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
768 </para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
769 <table frame="none">
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
770 <title>Command Line and Option Flag Examples</title>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
771 <tgroup cols="3">
633
14e792902588 Convert to Docbook XML format
roug
parents: 631
diff changeset
772 <colspec colwidth="1.5in" colname="c1"/>
14e792902588 Convert to Docbook XML format
roug
parents: 631
diff changeset
773 <colspec colwidth="1.5in" colname="c2"/>
14e792902588 Convert to Docbook XML format
roug
parents: 631
diff changeset
774 <colspec colwidth="1.5in" colname="c3"/>
472
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
775 <thead>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
776 <row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
777 <entry>command line</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
778 <entry>action</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
779 <entry>output file(s)</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
780 </row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
781 </thead>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
782 <tbody>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
783 <row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
784 <entry>cc prg.c</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
785 <entry>compile to an executable program</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
786 <entry>prg</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
787 <entry></entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
788 </row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
789 <row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
790 <entry>cc prg.c -a</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
791 <entry>compile to assembly language source code</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
792 <entry>prg.a</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
793 </row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
794 <row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
795 <entry>cc prg.c -r</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
796 <entry>compile to relocatable module</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
797 <entry>prg.r</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
798 </row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
799 <row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
800 <entry>cc prg1.c prg2.c prg3.c</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
801 <entry>compile to executable program</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
802 <entry>prg1.r, prg2.r, prg3.r, output</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
803 </row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
804 <row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
805 <entry>cc prg1.c prg2.a prg3.r</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
806 <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
807 and executable program</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
808 <entry>prg1.r, prg2.r</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
809 </row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
810 <row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
811 <entry>cc prg1.c prg2.c -a</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
812 <entry>compile to assembly language source code</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
813 <entry>prg1.a, prg2.a</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
814 </row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
815 <row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
816 <entry>cc prg1.c prg2.c -f=prg</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
817 <entry>compile to executable program</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
818 <entry>prg</entry>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
819 </row>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
820 </tbody>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
821 </tgroup>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
822 </table>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 468
diff changeset
823
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
824 </section>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
825 </chapter>