Bloggst Homepage
Welcome! You have found your way to Bloggst, a community for bloggers. Apart from providing you with daily updated articles on blogging, the main feature of Bloggst is our thriving discussion forum. If you wish to participate in the discussions you will need to register. It will only take a minute of your time, and it is completely free. If you wish to know more about us first, take a look at our about page.
Go Back   Bloggst Forums > General Blogging > Design and Code

Tags:  

Reply
 
Thread Tools
Old #1 - 04-09-2010, 04:04 AM
 
sakiraa1 
New Bloggster
 
Join Date: Apr 2010
Posts: 5
sakiraa1 is on a distinguished road
Thumbs up Compiler Design - Choosing Intermediate Code

The basic principle of any compiler is to read the source file and to generate compiled code. In practice the compilation process is not so simple. There is a huge leap between the source code written in a high-level language and the desired target code for a particular platform. In general, each high-level statement will be translated to many low-level instructions for our target microprocessor.

In theory, it is possible to directly translate each source code statement to a sequence of microprocessor instructions which will perform the desired result. However, in practice it is better to perform the compilation in two steps. The first step is to process the source code and generate an intermediate code, and in the second step to process this code to generate the final executable code for our target microprocessor. There are many advantages in this approach.

It is a very good idea to have a target-independent intermediate code. This code is usually a description of the high-level statements with some simpler instructions that accurately represent the operations of the source code statements. This code will not execute in a real processor, it is only an internal representation of our high-level program. Since it uses simpler constructs than the high-level language it is much easier to determine the data and control flow. This is very important for optimization algorithms.

Target-independent intermediate code means that for each high-level language that needs to be supported we only have to write the first part of the compiler, the code generator is already written for the intermediate code which does not change. The same applies to the second part, the code generator. If we need to port our compiler to another platform, we only need to write a new code generator for the new processor.
__________________
m3 ds real
sakiraa1 is offline   Reply With Quote
Register to see smaller and less intrusive ads!
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Choosing the Best Domain Name for Your Blog DebNg Blogging 0 02-10-2008 12:38 PM
Choosing a Self Publishing Company DeniseG Writing 0 02-07-2008 06:05 AM
How to create a compiler gregoftheweb Technology 0 09-19-2007 03:38 PM
Help with choosing gadgets! infektia Personal 0 05-17-2007 12:48 PM


All times are GMT -8. The time now is 12:05 PM.
Home | About | Contact Us | Archive | Top
All content and images, unless specified otherwise, is copyright © 2011, Bloggst.com | Jobs | CPA Affiliate Network
Powered by vBulletin® - Copyright ©2000 - 2007, Jelsoft Enterprises Ltd