SmallerC – Simple C Compiler

https://github.com/alexfru/SmallerC
Smaller C is a simple and small single-pass C compiler,
currently supporting most of the C language common between C89/ANSI C
and C99 (minus some C89 and plus some C99 features).
Currently it generates 16-bit and 32-bit 80386+ assembly code for NASM
that can then be assembled and linked into DOS, Windows, Linux and Mac OS X
programs.
(You may use YASM or FASM instead of NASM)
Code generation for MIPS CPUs is also supported (primarily for RetroBSD).
The compiler is capable of compiling itself.
The core compiler comes with a preprocessor (ucpp), a linker and a compiler
driver (the driver invokes the preprocessor, the core compiler, the assembler,
and the linker and supports options similar to those of gcc).
The standard C library is work-in-progress and it's close to completion.
See the project documentation for more up-to-date details:
https://github.com/alexfru/SmallerC/tree/master/v0100/doc
For the lack of a better place, you can discuss Smaller C here:
https://hackaday.io/project/5569-smaller-c
Links:
NASM: http://nasm.us/
YASM: http://yasm.tortall.net/
FASM: http://flatassembler.net/
CWSDPMI: https://sandmann.dotster.com/cwsdpmi/
HX DOS Extender: https://web.archive.org/web/20141003032346/http://www.japheth.de/
RetroBSD: http://retrobsd.org/
Other projects based on/using Smaller C:
"ROM C" (like ROM Basic but C): https://hackaday.io/project/29198-native-c-pic32-color-video-on-tv
FYS OS: http://www.fysnet.net/fysos.htm
NewBasic Compiler: http://fysnet.net/nbc.htm
Sweet32 CPU and toolchain: https://github.com/Basman74/Sweet32-CPU
Normative and other useful documents on C:
C99 + TC1 + TC2 + TC3, WG14 N1256:
  http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf
Dave Prosser's C preprocessing algorithm annotated by Diomidis D. Spinellis:
  http://www.spinellis.gr/blog/20060626/index.html
Rationale for C99:
  http://www.open-std.org/jtc1/sc22/wg14/www/docs/C99RationaleV5.10.pdf
The New C Standard: An Economic and Cultural Commentary:
  http://www.knosof.co.uk/cbook/cbook.html
The Development of the C Language by Dennis M. Ritchie:
  https://www.bell-labs.com/usr/dmr/www/chist.html
The Standard C Library by P.J. Plauger
  https://www.amazon.com/dp/0131315099
{
"by": "keepamovin",
"descendants": 1,
"id": 40246521,
"kids": [
40295836
],
"score": 3,
"time": 1714736484,
"title": "SmallerC – Simple C Compiler",
"type": "story",
"url": "https://github.com/alexfru/SmallerC"
}
{
"author": "alexfru",
"date": null,
"description": "Simple C compiler. Contribute to alexfru/SmallerC development by creating an account on GitHub.",
"image": "https://opengraph.githubassets.com/8e4955e43370b4e8005a052f03624e932b479d5eebf2cc9e9336557d6cfc93a4/alexfru/SmallerC",
"logo": "https://logo.clearbit.com/github.com",
"publisher": "GitHub",
"title": "GitHub - alexfru/SmallerC: Simple C compiler",
"url": "https://github.com/alexfru/SmallerC"
}
{
"url": "https://github.com/alexfru/SmallerC",
"title": "GitHub - alexfru/SmallerC: Simple C compiler",
"description": "Smaller C is a simple and small single-pass C compiler, currently supporting most of the C language common between C89/ANSI C and C99 (minus some C89 and plus some C99 features). Currently it generates 16-bit...",
"links": [
"https://github.com/alexfru/SmallerC"
],
"image": "https://opengraph.githubassets.com/8e4955e43370b4e8005a052f03624e932b479d5eebf2cc9e9336557d6cfc93a4/alexfru/SmallerC",
"content": "<div><pre>Smaller C is a simple and small single-pass C compiler,\ncurrently supporting most of the C language common between C89/ANSI C\nand C99 (minus some C89 and plus some C99 features).\nCurrently it generates 16-bit and 32-bit 80386+ assembly code for NASM\nthat can then be assembled and linked into DOS, Windows, Linux and Mac OS X\nprograms.\n(You may use YASM or FASM instead of NASM)\nCode generation for MIPS CPUs is also supported (primarily for RetroBSD).\nThe compiler is capable of compiling itself.\nThe core compiler comes with a preprocessor (ucpp), a linker and a compiler\ndriver (the driver invokes the preprocessor, the core compiler, the assembler,\nand the linker and supports options similar to those of gcc).\nThe standard C library is work-in-progress and it's close to completion.\nSee the project documentation for more up-to-date details:\n<a target=\"_blank\" href=\"https://github.com/alexfru/SmallerC/tree/master/v0100/doc\">https://github.com/alexfru/SmallerC/tree/master/v0100/doc</a>\nFor the lack of a better place, you can discuss Smaller C here:\n<a target=\"_blank\" href=\"https://hackaday.io/project/5569-smaller-c\">https://hackaday.io/project/5569-smaller-c</a>\nLinks:\nNASM: <a target=\"_blank\" href=\"http://nasm.us/\">http://nasm.us/</a>\nYASM: <a target=\"_blank\" href=\"http://yasm.tortall.net/\">http://yasm.tortall.net/</a>\nFASM: <a target=\"_blank\" href=\"http://flatassembler.net/\">http://flatassembler.net/</a>\nCWSDPMI: <a target=\"_blank\" href=\"https://sandmann.dotster.com/cwsdpmi/\">https://sandmann.dotster.com/cwsdpmi/</a>\nHX DOS Extender: <a target=\"_blank\" href=\"https://web.archive.org/web/20141003032346/http://www.japheth.de/\">https://web.archive.org/web/20141003032346/http://www.japheth.de/</a>\nRetroBSD: <a target=\"_blank\" href=\"http://retrobsd.org/\">http://retrobsd.org/</a>\nOther projects based on/using Smaller C:\n\"ROM C\" (like ROM Basic but C): <a target=\"_blank\" href=\"https://hackaday.io/project/29198-native-c-pic32-color-video-on-tv\">https://hackaday.io/project/29198-native-c-pic32-color-video-on-tv</a>\nFYS OS: <a target=\"_blank\" href=\"http://www.fysnet.net/fysos.htm\">http://www.fysnet.net/fysos.htm</a>\nNewBasic Compiler: <a target=\"_blank\" href=\"http://fysnet.net/nbc.htm\">http://fysnet.net/nbc.htm</a>\nSweet32 CPU and toolchain: <a target=\"_blank\" href=\"https://github.com/Basman74/Sweet32-CPU\">https://github.com/Basman74/Sweet32-CPU</a>\nNormative and other useful documents on C:\nC99 + TC1 + TC2 + TC3, WG14 N1256:\n <a target=\"_blank\" href=\"http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf\">http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf</a>\nDave Prosser's C preprocessing algorithm annotated by Diomidis D. Spinellis:\n <a target=\"_blank\" href=\"http://www.spinellis.gr/blog/20060626/index.html\">http://www.spinellis.gr/blog/20060626/index.html</a>\nRationale for C99:\n <a target=\"_blank\" href=\"http://www.open-std.org/jtc1/sc22/wg14/www/docs/C99RationaleV5.10.pdf\">http://www.open-std.org/jtc1/sc22/wg14/www/docs/C99RationaleV5.10.pdf</a>\nThe New C Standard: An Economic and Cultural Commentary:\n <a target=\"_blank\" href=\"http://www.knosof.co.uk/cbook/cbook.html\">http://www.knosof.co.uk/cbook/cbook.html</a>\nThe Development of the C Language by Dennis M. Ritchie:\n <a target=\"_blank\" href=\"https://www.bell-labs.com/usr/dmr/www/chist.html\">https://www.bell-labs.com/usr/dmr/www/chist.html</a>\nThe Standard C Library by P.J. Plauger\n <a target=\"_blank\" href=\"https://www.amazon.com/dp/0131315099\">https://www.amazon.com/dp/0131315099</a>\n</pre></div>",
"author": "",
"favicon": "https://github.githubassets.com/favicons/favicon.svg",
"source": "github.com",
"published": "",
"ttr": 51,
"type": "object"
}