Intermediate Representation


VARIANT 1 :-

1) We may have IS, AD , DL in our program so we have to write ( class, its number )

2) Operand registers are written with single digit.

3) The second operand which is a memory operand, is represented by a pair of the form ( operand class, code ) Where operand class is one of C, S and L standing for constant, symbol and literal respectively.

4) The first operands may be register value for instruction. If the instruction is BC then first operand is having value 1 to 6 .

VARIANT 1

Q.        Write Intermediate Representation ( IR ) and machine code for following assembly language program .  (6 m)

 Intermediate Representation

VARIANT 2 :-

1) Variant 2 will be same for AD and DL. Only for IS the first operand is written as it is. For second operand only for literal they follow VARIANT format, rest all is written as it is from input.

 variant 2

Q.        Compare  variant 1 and variant 2 of Intermediate representation.

Sr. No.VARIANT 1    VARIANT 2
1Extra work required in pass 1Pass 1 performs simple task
2IR is very much compact       IR is not compact.
3Pass 2 per forms simple task.Pass 2 requires extra work.
4Wastage of memory takes place Memory saving accurs.

 variant 1 and variant 2


References

  • WikiNote Foundation

Last modified: Thursday, 19 September 2019, 11:15 PM