Compiler Writing
RE:Compiler Writing
Just make sure you have a C compiler to compile it with. (Chicken and Egg)
GCC is completely written in C. But you can't compile it without GCC...
Why don't you use GCC instead? Modifications to BFD should be sufficient if you have a different ABI and ELF.
GCC is completely written in C. But you can't compile it without GCC...
Why don't you use GCC instead? Modifications to BFD should be sufficient if you have a different ABI and ELF.
RE:Compiler Writing
It's even easier to modify LCC to suit your needs (afterall, that's basically what it's designed for). Specifically version 3.6. 4.0 is a better compiler, but not as well documented (there's an entire book (written by the authors of the compiler) dedicated to using, porting, and retargetting LCC 3.6)
I've modified 3.6 to use nasm as the assembler backend, and RDOFF as the object output. It took all of about half an hour
Cheers,
Jeff
I've modified 3.6 to use nasm as the assembler backend, and RDOFF as the object output. It took all of about half an hour
Cheers,
Jeff
RE:Compiler Writing
I have one question. Is the compiler that you want to write dedicated to run under your own os or an amator's one, or it should run under LINUX or BeOs for example!!!!!
RE:Compiler Writing
My port of LCC is designed to run under my OS, eventually, but for the time being it runs under Linux (and should run under any OS, as long as nasm exists).
Jeff
Jeff
RE:Compiler Writing
All is OK. You should start by writing the libs and the header files that you intend to use using assembly or c itself, then start programming!
Now all depends on the executable file format that your os is using.
Have you ever written an compiler?
Now all depends on the executable file format that your os is using.
Have you ever written an compiler?
RE:Compiler Writing
No, actually I haven't even written one line of the operating system, I just wanted to know 'bout the languages I can use. Thanks for you issuing the information anyway.