wanted: c compiler that outputs asm
wanted: c compiler that outputs asm
Hi,
Does anyone know of a small-c or tiny c compiler that spits out assembly (either nasm or fasm format)?
All the one's I've come across so far are for embedded targets like avr, pic, etc.
The reason I'm asking is because I FINALLY ported fasm to Kube OS and want something higher level to play with. I've managed a port of my zc compiler but it's not that great.
Does anyone know of a small-c or tiny c compiler that spits out assembly (either nasm or fasm format)?
All the one's I've come across so far are for embedded targets like avr, pic, etc.
The reason I'm asking is because I FINALLY ported fasm to Kube OS and want something higher level to play with. I've managed a port of my zc compiler but it's not that great.
Re: wanted: c compiler that outputs asm
I don't know if it is small enough for you, but GCC can do that.
Try -S -masm=intel options.
Try -S -masm=intel options.
If something looks overcomplicated, most likely it is.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: wanted: c compiler that outputs asm
cute little gcc, eh?
Re: wanted: c compiler that outputs asm
Well, gcc-core is smaller than the whole gcc package...
Re: wanted: c compiler that outputs asm
Well,there is manykubeos wrote: Does anyone know of a small-c or tiny c compiler that spits out assembly (either nasm or fasm format)?
1) 16 bit compiler
turbo c
TCC -S yourCFile.cpp
will generate yourCFile.asm
Note:the code is 286 TASM like syntax
2) 32 bit compiler
2.1 Digital Mars
http://www.digitalmars.com/
Unfortunately,commercial compiler
DMC -cod yourCFile.c
Generate .cod (assembler output) file
Causes obj2asm to be run on the .obj file output from the
compiler to generate a .cod file showing the assembly
code generated. Using this along with the -gl switch will
generate a mixed source/assembly .cod file.
2.2 AttoC Free C Compiler
http://www.geocities.com/SiliconValley/ ... /attoc.htm
not bad C compiler
3) Nwcc
http://wiki.osdev.org/Nwcc
Coooool
must see - Hard to describe.
Distance doesn't make you any smaller,
but it does make you part of a larger picture.
but it does make you part of a larger picture.
Re: wanted: c compiler that outputs asm
Not bad?AhmadTayseerDajani wrote:2.2 AttoC Free C Compiler
http://www.geocities.com/SiliconValley/ ... /attoc.htm
not bad C compiler
My suggestion would be to avoid this oneFree C Compiler Website wrote:In fact, this compiler does not even support all the major features of C. The biggest one's that I can think of are listed below:
Pointers
Arrays
For loops
The only data type supported is int
The only C library function supported is printf()
Cheers,
Adam
Re: wanted: c compiler that outputs asm
froggey's checklist for porting GCC!
Do you have:
But if that isn't your thing, you could also try:
PCC, the BSD's compiler: http://pcc.ludd.ltu.se/
TCC, from the author of qemu: http://bellard.org/tcc/
Do you have:
- A function to create a process?
- Most of the C string.h functions?
- Most of the common C stdio.h functions? (fopen/fclose/fprintf/fread/etc)
- A way to get information about files? (stat)
- A way to read directories? (opendir/readir/closedir)
- Support for malloc/realloc/calloc/free?
- Time? (If you have time to write an OS, you probably have time to port GCC)
But if that isn't your thing, you could also try:
PCC, the BSD's compiler: http://pcc.ludd.ltu.se/
TCC, from the author of qemu: http://bellard.org/tcc/
Re: wanted: c compiler that outputs asm
I'm sorry, I should have mentioned this.. I am working on a GCC port still... but I'm not happy with the size of it. Newlib's libc is over 2 megs.I think GCC compiled to 170k, which isn't too bad.
I'm really looking for some smaller tools. I DID find a small-c for Windows that came with the source last night, so I think with a little work I could probably port this to my OS.
I also found one for DexOS and KolibriOS which I believe are all based on the same sources.. so with a little work I should be able to get something working. Thanks for your replies.
I'm really looking for some smaller tools. I DID find a small-c for Windows that came with the source last night, so I think with a little work I could probably port this to my OS.
I also found one for DexOS and KolibriOS which I believe are all based on the same sources.. so with a little work I should be able to get something working. Thanks for your replies.
-
- Member
- Posts: 566
- Joined: Tue Jun 20, 2006 9:17 am
Re: wanted: c compiler that outputs asm
1) Tiny c compiler
2) SDCC
3) Small C compiler
4) Build your own , A decent subset of C can be parsed using an RDP
Regards
Sandeep
2) SDCC
3) Small C compiler
4) Build your own , A decent subset of C can be parsed using an RDP
Regards
Sandeep
Re: wanted: c compiler that outputs asm
Another more complicated way to do this is to find a good disassembler. That way you can use whatever compiler you want, in theory.
http://www.freeprogrammingresources.com
http://www.thefreecountry.com
http://www.freeprogrammingresources.com
http://www.thefreecountry.com