Kjell Enblom
<5575>
· Text 445 · w8 · kommentar
1986-03-16 21:23
Ärende: Small c
Jag citerar smallc.doc
'Compiler restrictions
(1) Structures.
(2) Multi-dimensional arrays.
(3) Floating point, long integer, or unsigned data types.
(4) Functional calls returning anything but "int".
(5) The unaries "!", "ü", and "sizeof".
(6) The control binary operators "&&", "öö", and "?:".
(7) The declaration specifiers "auto", "static", "extern", and
"register".
(8) The statements "for", "switch", "case", and "default".
(9) The use of arguments within a "#define" command. '
Dessutom så tillkommer 4 st restriktioner
(1) Since it is a single-pass compiler, undefined names are not detected
and are assumed to be function names not yet defined.
(2) No optimizing is done.
(3) Since the target assembler is of unknown characteristics, no attepmt
is made to produce pseudo-ops to declare static variables as internal
or external.
(4) Constants are not evaulated by the compiler. That is,
the line of code:
X= 1+2 ;
would generated code to add "1" and "2" at runtime.
The results are correct, but unnecessary code is the penalty.
Nu vet du vad som inte går att göra med small c.
Men för den som är bra på 8080 assembler ( och har tid) så
medföljer källkoden till small c.
Det finns dessutom en bok om just lilla c, som är skriven av
Hendrix ( eller någonting liknande ) och finns att få tag på
via Dr Dobbs Journal.
Mvh Kjell E.