Why not download one of the free linux compilers?Quote:
Originally Posted by jolley
Printable View
Why not download one of the free linux compilers?Quote:
Originally Posted by jolley
:pQuote:
Originally Posted by Pinky98
regards,
jolley
Follow this link The Compilers resources page
For a tutorial how to write compiler (in pdf files) click me.
Another tutorial is here - Let us build a compiler
best of luck.:thumb:
I once wrote a "compiler" for a microchip (VERY basic functionality and instruction set).
It did the following:
1) Rewrite everything into a nice standard format. (i.e. remove exsesive white space, expand macros, one line = one command)
2) Identify all constant declarations and replace them thoughout the code.
3) Identify all variables (This one only had global variables)
4) Define some kind of lookup table to relate a variable name to a memory space (<< dynamic)
5) Interperate each line of code. This meant identifying the command. Then, using that command, place the required entries into your machine code listing (replcaing variable names with the table hash).
That was basically it. Wrote it in VB...
Hope that gives you some clues...
As far as free linux compilers... just download the source and take a look at it. It will have certain elements that are linux specific but on the whole it will be re-usable/ readable code.
The nice thing about your project is that to get PRINTF working... you don't have to write the assembler for PRINTF because it is found in a library.
With so little experience why are you writing a compiler, there must be something else you can write that's better suited to your experience.
regards,