Eco-C compiler.pdf

(1524 KB) Pobierz
Table
of
Contents
Getting Started
.
Features
of
EcO-C
Suggestions
Facts,
Using
the
ECO-C
C
.
.
and Programming
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Hints.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
2
3
5
5
5
7
7
l
Compiling
the Program.
Switches.
Compiler
. .
Assembling
the Program
Linking
the Program.
.
Your
and
Own
Compiler.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Linking
Reading
Functions.
8
9
9
10
12
13
24
25
26
27
28
29
31
33
39
40
41
Writing
Reading
what
Writing
Data
Files.
an
ASCII
Text
File
an ASCII Text
File
You
Run
to
Do
if
Out
of
Memory
.
.
.
.
Standard
Assembly
Assembler
Library
Language
Language
a
of
C
Functions
.
.
Functions
Using INIT.ASM
.
Naming Conventions
Invoking
Function Interface
Function in
Assembler
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Language.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Creating Libraries.
CP/M
.
.
.
.
.
.
.
I/O Interface.
Messages.
Operator
.
Error
Quick
Function
Reference.
Precedence.
80
Microsoft's
MACRO
manual
Getting Started
M&kinq
,a
workinq
Cqry
should
do
is
make
a
working
copy
of
the
the
you use
the
CP/M PIP
A
and
in
your
CP/M
disk with
PIP on
<CR>
drive
(We
have used
to
signify
disk in
b.
key.)
The
ECo-C
C
sequence
a
first
thing
you
Compiler disk.
is
to place
formatted
RETURN
If
blank,
pressing
it
utility,
the
A>PIP
<CR>
*
B:
=A:*.*
(now place
<CR>
(
(Use
the
ECO-C
disk
<----
and
enter this
DV
option for copyinh
in
A)
line)
the
the
After
and copy
is
completed, place
You
original
disk in
a
safe
use
the
copy
from
now on.
place
will
need
the
following
files
when
compiling
a
program:
CP.
COM
XC. COM
XM.
COM
CE. COM
CODE. PS
CODE. PA
ERR. PA
STDIO.
h
Macro
Pre-processor
C
Compiler
Code
Generator
Error
Reports
Overhead
Files
"
"
"
"
Standard
* .REL
M80 .COM
L80
.COM
Library
Routines
(All
of them)
Microsoft's
Macro Assembler
"
Linker
Definitions
compiled program
will
generate
(on
its
own)
and
as
intermediate
files
during compilation.
These
intermediate
the
files
You
probably
will
be
erased automaticallyplace
as
your
want
to
compilation progresses.
will
on
the
editor
ED.COM).
disk, too (e.g.,
a
the
editor
on
your
CP/M
disk is
named
you use
screen
editor
like
Micropro's
be sure
If
you
write
your programs
Wordstar,
in
the "non-document"
mode.
Finally,
do
not
write
programs using the
file
names
above.
each
TOKEN.CWK
PCODE.CWK
In
addition,
l
split
DISKI
DISK2
DISK3
If
disk
space
as
follows:
-
-
-
Using
CP.COM,
ERR. PA
M80.COM
is
a
problem,
the
files
may have
a
maximum
XC.COM,
XM.COM,
CE.COM,
CODE.PS,
CODE.PA,
L80.COM,
EC2.
REL
CFF.REL,
CIF.REL,
CFC.REL,
CIC.REL,
ECC.REL,
be used
for
the source
compiler output
assembler output.
DISKI
is
used
for
the
compiler
and the
compiler working
files;
while
DISK3
is
used
for linking
the
output of
the assembler and the
compiler
libraries.
Depending on
disk size, groupings of the
above
disks
be done. For example,
may
on a
North
Star
system DISK2 and DISK3
typically
would be combined
into
one
disk (e.g.,
a
DISK2)
.
may
the
above
file,
distribution
of
files,
and
DISK2
ready
Having
made
a
working
to write
and compile
a
copy
of the
Eco-C
C
program.
compiler,
you
are
Features
of
Eco—C
Before you
start
using the
compiler,
and
is
not supported
in this release.
The
you should
know what
is
full
a.
c.
d.
e.
C
syntax is
supported
except;
be
available
in
are
supported.)
bitfields
b.initializers(lnitializers
should
1983. Aggregate
Initializers
April,
parametized
#line
macro
preprocessor directive
in
compound
expression following
pansion
is
not done
above
macros
a
#if
,
macro
ex-
available in
subsequent
releases
of
the
additional optimization
(we've concen-
compiler.
We
trated
on
longs
and
floats
so
far)
to
substantially
shrink
code
size
and
increase
speed.
You
must have
a
signed
license
agreement
on
file
to
be
eligible
for
these updates.
Most
of
the
will
be
also
expect
2
Facts,
The
Suggestions
and programming
Hints
following is
a
list
of
specifications
and
suggestions
that
may
prove
useful.
Some
represent
"C
spec"
rules that
are
jÁQt
obeyed by
existing
compilers
and
might
cause
an
error
message
that
would not be generated by
other compilers.
Others are
limi-
tations
types
that
will
disappear
shortly.
l.
unsigned long,
will
generate
an
unsigned char
error
message.
and
unsigned short
data
stdin, stdout, stderr
and
stdlst
equate
to
fdO,
fdl,
fd2,
(A
controls
respectively.
file
named INIT.ASM
setting
the the number
and
lob's that
are generated
stack.)
of fcb's
plus
2.
and fd3
3.
function
calls:
of
float
is automatically
a.
A
function
parameter
pro-
moted
to
double and
short
or char goes
to
an
int.
b.
A
function
cannot
return
a
char; only
an
int,
unsigned, long, double,
or
pointer
no
matter
how
declareá.
c. Given
the choice of char
or
int,
make
it
an
int.
It
avoids
internal conversions,
thus improving speed.
On
4
-
'
-'
'
(e.g.,
.
initialize
funcl())
,
the syntax
To
a
x
pointer
must
be:
(e. g.
,
x_
pt
r
)
to
a
function
_ptr
=
&funcl;
5.
A
with
of
it:
it,
or
6.
structure
or
union
name can
only
have
two things
done
l)
take
a
address with the address operator in
front
its
2) have
period
and
a
member name
following
its
name.
message.
7.
Binding of structure
members
to
a
structure is absolute.
a
sI
and
pointer
If
a
you must
is
to
the
structure
to
S2
or now you want
to
use an
with
it
error
S2,
we
will
generate
pointer
cast
to
off
generates
If
If
a
function
is
declare variables
more
efficient
not recursive,
as
static
rather
code.
you
are usually
better
than auto or
register.
8.
likely
9.
When
using
a
large "switch"
case
Last
and the
least
likely
statement,
first.
place the
most
Currently
we
do
support
nested
comments.
3
10.
#include's
Floating
may
be nested
only
two deep.
II.
digits.
12.
time
point
numbers can have up
to
17
significant
The range
for
the exponent is -38 to
+38.
At the present
(BCD
time, only binary arithmetic is
supported
is forthcoming).
Floating
rather
than
compile
point
and
long constants are
combined
time. This, too,
will
be
fixed.
with
this
a
at run
carriage-
cause
13.
the
return, linefeed
error handler
14.
We
All
program
source
f
lies
must
terminate
pair
(CR-LF).
Failure to
observe
to
produce odd
results.
:,
."?
,
t
a.
" "
will
do
a
appending to
finished.
The
not yet
have:
f lle.
This
will
lseek()
·QL-.c.un.link(>
functions,
disappear
when random
and
files
are
grow
of
majority
The
the
limitations
mentioned
above
will
dis-
appear
very
soon.
error handler
treats
all
errors
as
fatal;
there is
no
"cascading" of false error
messages.
When
you
do
get
the
error correct-
an
error,
you
will
find that
it
does diagnose
ly. Finally,
the
library
is
a
bit
meager
at present, but
will
shortly.
find
the Eco-C
compiler
more
"UNIX-like"
you
than most
on
the market.
Further,
perf
orms
its
error
checking
with
the
syntax defined
by
K&R.
Finally,
we
in
strict
compliance
presented
have adhered
to
the
function definitions
in
K&R
as much
as
possible
in
a CP/M
environment.
we
think
will
it
.
4
Zgłoś jeśli naruszono regulamin