Small-C
| Company type | Compiler |
|---|---|
| Industry | Software, Programming languages |
| Founded | May 1980 |
| Founder | Ron Cain |
| Headquarters | United States |
| Products | Small-C compiler |
Small-C represents a streamlined variant of the C language tailored specifically for microcomputers and embedded systems with limited resources. The term also denotes its initial implementation. It established early prominence as a microcomputer compiler during the late 1970s and early 1980s and continues to serve as an effective introductory teaching resource.
Ron Cain originally developed the Small-C compiler targeting the Intel 8080, with its first publication appearing in the May 1980 edition of Dr. Dobb's Journal. Subsequently, James E. Hendrix enhanced this compiler and authored The Small-C Handbook. Cain created Small-C on the SRI International PDP 11/45 running Unix, assisted by John Bass. With organizational consent, the source code was released into the public domain. Small-C held a crucial position in small computing environments, much like GCC’s role in larger-scale systems. Similar to Unix compilers, it outputs assembler code, which then requires an assembler to convert into executable machine instructions.
As a retargetable compiler, Small-C’s backend code generator and operating system interface library are designed for adaptation across various processor architectures, enhancing its portability.
Language subset
In May 1980, Ron Cain unveiled a compact compiler targeting an 8080-based C subset, notable for being self-hosted—written using the very language it compiles. This single-pass compiler generated assembly code for the 8080 but supported only characters, integers, one-dimensional arrays, and while loops. It lacked Boolean operators; instead, bitwise operators & and | were used as substitutes. Despite these constraints, it provided a viable alternative to programming directly in assembly language.
Addressing requests for expanded functionality, James E. Hendrix released an upgraded version in December 1982 that introduced features such as code optimization, data initialization, conditional compilation directives, the extern storage class, additional control flow constructs (for, do/while, switch, goto), compound assignment operators, Boolean operators, the ones' complement operator, block-scoped variables, among others. By 1984, Hendrix collaborated with Ernest Payne to create a CP/M-compatible runtime library containing over 80 functions that replicated UNIX C Standard I/O Library capabilities relevant to CP/M systems. This release became version 2.1 and formed the foundation of The Small C Handbook.
In 1988, Rick Grehan adapted Small-C for MS-DOS and Macintosh environments to support new benchmarking tools featured in BYTE magazine.
See also
- BDS C (1979) – C compiler designed for Z80 and 8080 platforms
- MISOSYS C (1985) – C compiler targeting TRS-80 systems with Z80 CPUs
- Tiny C (2002) – Compact C compiler for low-resource x86 and ARM architectures
Small-C variants
- Z88DK – Cross-platform Small-C implementation for Z80 microcomputers
- cc65 – Cross Small-C variant targeting 6502 processor-based systems
- Deep Blue C – Small-C adaptation for Atari 8-bit computers
- A.J.Travis – Native Small-C version developed for the BBC Micro
Notes
- Ron Cain, "A Small C Compiler for the 8080's", Dr. Dobb's Journal, April–May 1980, pp. 5–19
- James E. Hendrix, The Small-C Handbook, Reston 1984
- James E. Hendrix, A Small C Compiler: Language, Usage, Theory, and Design, M & T Books 1988
- James E. Hendrix, Small C Compiler, M & T Books 1990