Category Archives: Uncategorized

Position of code generator in compiler

This is the last stage of the compiler. The input code generator is an intermediate representation of the source program, while the output is the equivalent target program.

The position of the code generator in the compiler is as follows:

  • Code generator
  • Symbol table
  • Code optimizer
  • Source
  • program
  • intermediate
  • code
  • intermediate
  • code
  • Target
  • program
  • Front end

Code generator requirements:

The output code must be correct and of high quality, that is, it must use the resources of the target machine effectively
must be efficient.


Although it really depends on the target machine and operating system, the important problems in code generation are:

  • Input for code generator
  • Program targets
  • Memory Management
  • Instruction Selection
  • Register Allocation
  • Selection Order Evaluation
  • Code Generator Approach


The input consists of an intermediate representation of the source program generated by the front-end, along with information in the symbol table that is used to determine the run time address of the data object in the intermediate representation.

It is assumed that before code generation, the front-end has to scan, parse, & translate the source program into a detailed intermediate detail representation.

In addition, type checking is also carried out on the above assumptions, so that type-con-version operators can be inserted where necessary and semantic errors have been detected.


Target program by the code generator that meets, the form is:

  • Absolute Machine Language
  • Relocatable Machine Language
  • Assembly Language

Absolute machine language: has the advantage that it can be placed in a fixed location in memory and can be executed directly.

Example :

a number of “student-job” compilers,

like WATFIV and PL/C

Relocatable Machine Language (Object Module): allows subprograms to be compiled separately (flexibility). A set of object modules can be linked/loaded together on linking-loader execution (requires extra effort)

Assembly Language: the advantage is that there is an easy code generation process for generating symbolic instructions and using macro facilities from the assembler to generate code.


Mapping names to addresses of data objects in run-time memory that runs together with the front-end and code generator.

It is assumed that the three-address statement references the name to the symbol-table entry.

The type in the declaration specifies the width (amount of storage) required for the declared name.


Uniformity and completeness are important factors, as are instruction speed and machine idioms.

Example :

Three-address statement, of the form:

x := y + z

where : x, y, z allocated statically can be translated into the following code sequence:

MOV y, R0/* load y to register R0 */

ADD z, R0/* add z to R0 */

MOV R0, x /* store R0 into x */

However, statement-by-statement often results in bad code. Example of a sequence of statements

a := b + c

d := a + e

can be translated into:

MOV b, R0

ADD c, R0

MOV R0, a

MOV a, R0

ADD e, R0

MOV R0, d

Here the third and fourth statements will be redundant, as will the third statement if a is not used sequentially.


Instructions involving register operands are usually shorter and faster than those involving operands in memory.

Therefore, efficient use of registers is very important to generate good code.

The use of registers is divided into 2 sub-problems:

1. During register allocation, the variables that will remain in the register are selected at some point in the program

2. During register assignment, a special register is taken where the variable will be assigned.

Finding the optimal assignment of registers to variables is difficult, even with single registers.

Mathematically, this problem is NP-Complete.


The order of computations can affect the efficiency of the target code. Some computational sequences require fewer registers to hold intermediate results than others. Taking the best order is the NP-Complete Problem.


The most important criterion is to produce good code.

The design objectives are:
easy to implement
easy to test
easy to maintain

If you are looking for telco digital transformation then read more .

Welcome to Free Gift Card Generator

Welcome to our unique and premium gift code site. We offer a collection of gift cards from various brands. Our online gift card generator could produce Google, Amazon, Stream, Xbox and many more gift cards like nothing else on the market. Gift cards allow the free purchase of products equivalent to the value specified on the gift card. Personal purchase on the side, this is an amazing gift item. Gift card recipients can get anything they really want with a gift card.

The only free gift card generator code!

You won’t find another platform like ours in the free gift card room. We created this site with just one goal – to give users a free gift card code without the need to buy it. Of course, creating this free gift card code generator to get a free gift card is not a piece of cake, but we managed to keep the promise. It takes a lot of failure and testing to come out with native software that performs tricks safely and comfortably. Keep in mind that we don’t throw hack gift codes on your face. Our generator provides unused and legit code that works 100% of the time by scanning the web for a list of unused gift codes.

Easy option to get free gift cards!

Unlike the competition, we don’t yet have the advanced process of getting a free gift card On our site, you simply select the code by clicking on the option you want and let the system generate the free code in minutes. Even an eight-year-old can use our site like a breeze. Better yet, we won’t ask you anything about your financial information. In addition, you don’t need to download anything. You just have to prove that you are human and not an automated bot created by hackers who break the rules of getting free gift cards without throwing arms and legs. Bots have created havoc in the past, so we have these extra steps to ensure they remain under scrutiny. Our free gift card code generator verifies each gift code before sending it. If you can’t follow the instructions above, check the entire process in the action below:

-Click the desired Gift Card Icon (for example; Amazon, Steam, Xbox, PSN, Google play etc…)

-Select the Denominational Gift Card you want to receive

-Click the ‘Generate’ button for our software to perform its magic

– Complete fast and hassle-free human verification tasks

-Bingo! Indulge in a Free Gift Card.

What are you waiting for?

Currently, we provide dozens of codes every day. So, be sure to grab them today or you may have to wait tomorrow if we run out of them for the day. Our gift card generator is 100% free for now. So, you don’t have to spend money or scavenge the web to get free gift cards anymore. We want you to enjoy your free gift code without the hopeless struggle that is generally involved in securing a legitimate gift code. Also, don’t forget to spread the value by sharing a free gift card code generator with residents who really deserve to know it.