Knowee
Questions
Features
Study Tools

What are the representations of three address code?

Question

What are the representations of three address code?

🧐 Not the exact question you are looking for?Go ask a question

Solution

Three-address code is an intermediate code used in compilers. It is a sequence of statements of the general form:

X = Y op Z

Where X, Y, and Z are simple variables, and op is an operator. The representations of three address code are:

  1. Quadruples: Quadruples are a common form of representing three address code. They consist of four fields: operator, argument1, argument2, and result. For example, for the statement "a = b + c", the quadruple would be (+, b, c, a).

  2. Triples: Triples are another form of representation. They consist of three fields: operator, argument1, and argument2. The position of the triple implicitly represents the result. For example, for the statement "a = b + c", the triple would be (+, b, c) and the position of this triple in the list of triples represents 'a'.

  3. Indirect Triples: Indirect triples are a modification of triples. They consist of a list of pointers to triples rather than the triples themselves. This allows for easy rearrangement of the statements for optimization.

Each of these representations has its own advantages and disadvantages, and the choice of which to use depends on the specific requirements of the compiler.

This problem has been solved

Similar Questions

What is three address code?

Explain in detail various addressing modes with examples

The binary address issued to data or instructions are called as ______*Physical addressLocationLogical addressRelocatable address

write three address instruction for given A + (B*C)-(D*E)

Explain why there must be three bases in each code.

1/3

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.