Smaller C compiler (Announce)
Hello fellow DOS lovers!
I'm not sure whether this fits best the Announce category or the Misc one, (moderator(s), feel free to correct).
I've come across this thread, Old 8086 version of pcc spotted (cross-compiles to DOS), and I'd like to share with you my recent work in the field.
For the past year I've been working in my spare time on a C compiler that could potentially target DOS. And, in fact, it already can. :)
Meet Smaller C!
Smaller C in not too many words (more on github):
- is much like the original Small C by Cain/Hendrix/etc and Micro-C by Dunfield, but with normal ANSI/C89 syntax and behavior (=no foul play in expressions as in Micro-C), work is underway to support more of C89
- generates NASM-agreeable 16- or 32-bit i80386 assembly code, and should be fairly easily adaptable to other assemblers if needed (I've been told, it takes an hour to adapt it to NBASM)
- -seg16t,-seg16,-flat16 options are for the 16-bit tiny/small memory models (ints and pointers are 16-bit, pointers are near)
- -seg32,-flat32 options are for 32-bit code (ints and pointers are 32-bit, pointers are near)
- -huge option is for a memory model similar to the huge memory model found in Borland/Turbo C/C++ compilers (ints and pointers are 32-bit, pointers are physical addresses, transparently converted into segments and offsets, no need to mess with far, MK_FP(), FP_SEG(), FP_OFF() and the like, you can pretend you're in 32-bit mode!; this should help with porting code to DOS or even writing new code for DOS)
- is trivially compilable with any C89+ compiler (Turbo/Borland C/C++, Open Watcom C/C++, djgpp, gcc, you name it) and can run in DOS
- (re)compiles itself (you can already make a DOS .EXE of Smaller C using only Smaller C (compiled with another compiler or itself) and NASM (2.03 or better), no linker needed)
- doesn't yet provide libc, though it should be easy to implement a basic library for DOS (the compiler itself needs only a handful of ctype/string/stdlib/stdio functions to operate and those are already available for bootstrapping for DOS)
- BSD licensed
More details (live document) can be found here, in the Wiki.
In the near future I'm going to add support for struct, short and long.
You're most welcome to play with Smaller C, report bugs and discuss it (and contribute:).
Alex
P.S. Robert, indeed, I'm the author of the Frounze Commander. :) Thanks for my new account on the forum!
Complete thread:
- Smaller C compiler - alexfru, 03.01.2014, 06:46 (Announce)
- Smaller C compiler - alexfru, 17.02.2014, 07:59
- Smaller C compiler - Oso2k, 19.02.2014, 18:46
- Smaller C compiler - alexfru, 19.02.2014, 21:04
- Smaller C compiler - alexfru, 25.02.2014, 09:19
- Smaller C compiler - alexfru, 02.03.2014, 06:29
- Smaller C compiler - alexfru, 10.03.2014, 09:45
- Smaller C compiler - alexfru, 21.04.2014, 05:04
- Smaller C compiler - alexfru, 14.09.2014, 12:03
- Smaller C compiler - alexfru, 09.11.2014, 12:18
- Smaller C compiler - alexfru, 28.11.2014, 13:13
- Smaller C compiler - alexfru, 21.12.2014, 11:28
- Smaller C compiler - alexfru, 10.01.2015, 19:39
- Smaller C compiler - alexfru, 20.04.2015, 08:52
- Smaller C compiler - alexfru, 26.04.2015, 06:12
- Smaller C compiler (tests under emulation) - Rugxulo, 07.05.2015, 10:33
- Smaller C compiler (tests under emulation) - alexfru, 08.05.2015, 09:32
- Smaller C compiler (tests under emulation) - Rugxulo, 08.05.2015, 17:10
- Smaller C compiler (tests under emulation) - tom, 08.05.2015, 20:31
- Smaller C compiler (tests under emulation) - Rugxulo, 09.05.2015, 02:57
- Smaller C compiler (tests under emulation) - alexfru, 10.05.2015, 00:25
- Smaller C compiler (tests under emulation) - Rugxulo, 10.05.2015, 04:46
- Smaller C compiler (tests under emulation) - Rugxulo, 21.05.2015, 03:26
- Smaller C compiler (tests under emulation) - Rugxulo, 10.05.2015, 04:46
- Smaller C compiler (tests under emulation) - tom, 08.05.2015, 20:31
- Smaller C compiler (tests under emulation) - Rugxulo, 08.05.2015, 17:10
- Smaller C compiler (tests under emulation) - alexfru, 08.05.2015, 09:32
- Smaller C compiler - alexfru, 17.05.2015, 02:51
- Smaller C compiler - alexfru, 15.08.2015, 11:20
- Smaller C compiler - alexfru, 07.09.2015, 00:57
- Smaller C compiler - alexfru, 14.06.2016, 11:24
- Smaller C compiler - Rugxulo, 19.06.2016, 02:22
- Smaller C compiler - alexfru, 14.06.2016, 11:24
- Smaller C compiler - alexfru, 07.09.2015, 00:57
- Smaller C compiler - alexfru, 15.08.2015, 11:20
- Smaller C compiler (tests under emulation) - Rugxulo, 07.05.2015, 10:33
- Smaller C compiler - alexfru, 26.04.2015, 06:12
- Smaller C compiler - Rugxulo, 04.09.2015, 03:19
- Smaller C compiler - alexfru, 04.09.2015, 07:22
- Smaller C compiler - Rugxulo, 06.09.2015, 02:32
- Smaller C compiler - alexfru, 06.09.2015, 07:05
- Smaller C compiler - alexfru, 07.09.2015, 04:14
- Smaller C compiler - Rugxulo, 08.09.2015, 00:48
- Smaller C compiler - alexfru, 08.09.2015, 01:08
- Smaller C compiler - Rugxulo, 12.11.2015, 03:02
- Smaller C compiler - Oso2k, 12.11.2015, 22:59
- Smaller C compiler - Rugxulo, 05.12.2015, 06:00
- Smaller C compiler - Oso2k, 12.11.2015, 22:59
- Smaller C compiler - Rugxulo, 14.06.2016, 03:34
- Smaller C compiler - alexfru, 14.06.2016, 11:16
- Smaller C compiler - Rugxulo, 15.06.2016, 01:00
- Smaller C compiler - alexfru, 15.06.2016, 09:11
- Smaller C compiler - Rugxulo, 16.06.2016, 19:26
- Smaller C compiler - alexfru, 17.06.2016, 10:36
- Smaller C compiler - Rugxulo, 18.06.2016, 18:26
- Smaller C compiler - alexfru, 19.06.2016, 00:08
- Smaller C compiler - Rugxulo, 19.06.2016, 01:56
- Smaller C compiler - Oso2k, 04.07.2016, 07:22
- Smaller C compiler - alexfru, 10.07.2016, 08:19
- Smaller C compiler - Rugxulo, 30.07.2016, 07:20
- Smaller C compiler - alexfru, 30.07.2016, 07:54
- Smaller C compiler - Rugxulo, 09.08.2016, 18:40
- Smaller C compiler - alexfru, 10.08.2016, 09:38
- Smaller C compiler - alexfru, 10.08.2016, 13:40
- Smaller C compiler - Rugxulo, 10.08.2016, 16:40
- Smaller C compiler - Rugxulo, 19.08.2016, 03:10
- Smaller C compiler - alexfru, 19.08.2016, 08:55
- Smaller C compiler - alexfru, 28.08.2016, 08:46
- Smaller C compiler - alexfru, 14.12.2016, 08:50
- Smaller C compiler - Rugxulo, 14.05.2017, 22:29
- Smaller C compiler - alexfru, 17.05.2017, 08:33
- Smaller C compiler - Rugxulo, 18.06.2017, 07:47
- Smaller C compiler - Rugxulo, 18.06.2017, 20:31
- Smaller C compiler - Rugxulo, 10.11.2017, 04:16
- Smaller C compiler - alexfru, 10.11.2017, 05:27
- Smaller C compiler - Rugxulo, 11.11.2017, 06:51
- Smaller C compiler - Rugxulo, 12.11.2017, 01:39
- Smaller C compiler - alexfru, 12.11.2017, 12:07
- Smaller C compiler - alexfru, 12.11.2017, 12:16
- Smaller C compiler - alexfru, 12.11.2017, 12:07
- Smaller C compiler - Rugxulo, 22.11.2017, 06:43
- Smaller C compiler - alexfru, 22.11.2017, 07:58
- Smaller C compiler - alexfru, 22.11.2017, 08:22
- Smaller C compiler - alexfru, 22.11.2017, 09:34
- Smaller C compiler - alexfru, 23.11.2017, 10:20
- Smaller C compiler - Rugxulo, 26.11.2017, 13:43
- Smaller C compiler - alexfru, 27.11.2017, 03:10
- Smaller C compiler - Rugxulo, 28.11.2017, 13:49
- Smaller C compiler - alexfru, 28.11.2017, 18:03
- Smaller C compiler - Rugxulo, 28.11.2017, 13:49
- Smaller C compiler - alexfru, 27.11.2017, 03:10
- Smaller C compiler - alexfru, 22.11.2017, 07:58
- Smaller C compiler - alexfru, 23.11.2017, 20:31
- Smaller C compiler - alexfru, 28.11.2017, 23:47
- Smaller C compiler - Rugxulo, 30.11.2017, 18:43
- Smaller C compiler - alexfru, 03.12.2017, 03:47
- Smaller C compiler - roytam, 05.12.2017, 16:08
- Smaller C compiler - alexfru, 12.12.2017, 08:26
- Smaller C compiler - Rugxulo, 13.12.2017, 00:53
- Smaller C compiler - Rugxulo, 20.12.2017, 02:12
- Smaller C compiler - Rugxulo, 30.11.2017, 18:43
- Smaller C compiler - Rugxulo, 12.11.2017, 01:39
- Smaller C compiler - Rugxulo, 30.11.2017, 19:37
- Smaller C compiler - alexfru, 03.12.2017, 03:48
- Smaller C compiler - Rugxulo, 11.11.2017, 06:51
- Smaller C compiler - alexfru, 10.11.2017, 05:27
- Smaller C compiler - Rugxulo, 18.06.2017, 07:47
- Smaller C compiler - alexfru, 17.05.2017, 08:33
- Smaller C compiler - Rugxulo, 14.05.2017, 22:29
- Smaller C compiler - alexfru, 14.12.2016, 08:50
- Smaller C compiler - alexfru, 28.08.2016, 08:46
- Smaller C compiler - alexfru, 19.08.2016, 08:55
- Smaller C compiler - Rugxulo, 09.08.2016, 18:40
- Smaller C compiler - alexfru, 30.07.2016, 07:54
- Smaller C compiler - Rugxulo, 30.07.2016, 07:20
- Smaller C compiler - alexfru, 10.07.2016, 08:19
- Smaller C compiler - alexfru, 19.06.2016, 00:08
- Smaller C compiler - Rugxulo, 18.06.2016, 18:26
- Smaller C compiler - alexfru, 17.06.2016, 10:36
- Smaller C compiler - Rugxulo, 18.06.2016, 18:20
- Smaller C compiler - alexfru, 19.06.2016, 00:22
- Smaller C compiler - alexfru, 20.06.2016, 07:51
- Smaller C compiler - alexfru, 19.06.2016, 00:22
- Smaller C compiler - Rugxulo, 16.06.2016, 19:26
- Smaller C compiler - alexfru, 15.06.2016, 09:11
- Smaller C compiler - Rugxulo, 15.06.2016, 01:00
- Smaller C compiler - alexfru, 14.06.2016, 11:16
- Smaller C compiler - Rugxulo, 12.11.2015, 03:02
- Smaller C compiler - alexfru, 08.09.2015, 01:08
- Smaller C compiler - Rugxulo, 08.09.2015, 00:48
- Smaller C compiler - Rugxulo, 06.09.2015, 02:32
- Smaller C compiler - alexfru, 04.09.2015, 07:22
- Smaller C compiler - alexfru, 20.04.2015, 08:52
- Smaller C compiler - alexfru, 10.01.2015, 19:39
- Smaller C compiler - alexfru, 21.12.2014, 11:28
- Smaller C compiler - alexfru, 28.11.2014, 13:13
- Smaller C compiler - alexfru, 09.11.2014, 12:18
- Smaller C compiler - alexfru, 14.09.2014, 12:03
- Smaller C compiler - alexfru, 21.04.2014, 05:04
- Smaller C compiler - alexfru, 10.03.2014, 09:45
- Smaller C compiler - alexfru, 02.03.2014, 06:29
- Smaller C compiler - Oso2k, 19.02.2014, 18:46
- Smaller C compiler - RayeR, 19.02.2014, 01:15
- Smaller C compiler - alexfru, 19.02.2014, 05:33
- Smaller C compiler - roytam, 30.03.2015, 04:49
- Smaller C compiler - alexfru, 30.03.2015, 06:42
- Smaller C compiler - roytam, 02.04.2015, 02:01
- Smaller C compiler - alexfru, 02.04.2015, 10:08
- Smaller C compiler - roytam, 02.04.2015, 02:01
- Smaller C compiler - alexfru, 30.03.2015, 06:42
- Smaller C compiler - alexfru, 17.02.2014, 07:59