4 ms·
I think the best first book is: James E. Hendrix, The Small-C Handbook, Reston 1984, ISBN 0-8359-7012-4 He explains every detail, goes through every routine, a
by GeorgeTirebiter 8y ago
I think the best first book is: James E. Hendrix, The Small-C Handbook, Reston 1984, ISBN 0-8359-7012-4
He explains every detail, goes through every routine, and you can see exactly what the compiler does. It's 'Small-C' so it doesn't have any fancy features, like floats or structs. But the basic machinery is there, and one can add features as desired. It does compile itself. The compiler outputs x86 assembly, which must be assembled and linked with standard programs.
The original Small-C was done by Ron Cain, and produced 8080 code. I like Mr. Hendrix' better because I have lots of x86 around (I specifically wanted it for my HP-200 LX palmtop, which I still have and works great!); and because the book is fantastic.
It's fully understandable in a small quantity of time. And, the back end is re-targetable, so you could, say, output to ARM or RISC-V or whatever.
I spoke with Mr. Hendrix some years ago, maybe 10 or so, and asked if he would consider putting the compiler into the public domain. He did.
- bogomipz 8y agoThanks for this suggestion. In case anyone else is interested, there is a freely available ISO of the the book available from Dr Dobbs Journal. From the README in the ISO: >"Welcome to Dr. Dobb's Small-C Resource CD-ROM, the definitive collection of Small-C related information and source code. This CD-ROM includes the full text to James Hendrix's book "A Small-C Compiler: Language, Usage, Theory, and Design," selected articles on Small-C from "Dr. Dobb's Journal" magazine, and Small-C implementations for a number of processor platforms, including the 8080, Z80, 6502, and others." It's available here: http://www.drdobbs.com/developer-network-small-c-compiler-book/184415519 http://www.drdobbs.com/developer-network-small-c-compiler-bo...