Jump to content
  • Advertisement
Sign in to follow this  

C++ Compiler

This topic is 4719 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am sure this question has been asked before a lot of times, but i couldnt find any threads on it. I have heard in a lot of places that there is a C++ compiler for almost every platform out. Now lets say that I came up with my own emulator for some new hardware that I invented. So obviously that system will have its own instruction set for its processor. My question is that if I need to write a C compiler (lets just say C because C++ is a bit advanced) for my system, how will I parse the C language? Any links/articles/tutorials/advice on how to do this? Help would be greatly appreciated, Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Unles you make a CPU by yourself, just use GCC, it compiles code for pretty much all the mainstream CPUs.
Or do you mean you want to make a virtual machine with it's own binary code?

Share this post


Link to post
Share on other sites
Quote:
Original post by Raduprv
Unles you make a CPU by yourself, just use GCC, it compiles code for pretty much all the mainstream CPUs.
Or do you mean you want to make a virtual machine with it's own binary code?


Even if you created a new CPU, it is still a good idea to extend GCC rather than creating anotehr compiler. GCC has been designed to ease new paltform support. The only thing you'll have to write si the back-end (the stuff that will generate the assembly language output) and the assembler itself, not a whole compiler.

Regards,

Share this post


Link to post
Share on other sites
Quote:
Original post by AcePilot
The GCC extension idea seems good, but how exactly do I do that?


Get the GCC source distribution and read through the docs. It's not easy, but it's better than writing one from scratch.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!