Here, given the expression - A: = -B*(C+D)
Three-address code :
T1 : = -B
T2 : = C+D
T3 : = T1+T2
A : = T3
These statement are represented by quadruples as shown in fig . (a)
SL NO | OP | ARG1 | ARG2 | RESULT |
---|---|---|---|---|
(0) | Uminus | B | - | T1 |
(1) | + | C | D | T2 |
(2) | * | T1 | T2 | T3 |
(3) | := | T3 | - | A |
Fig. (a) quadruple representation of three -address statements.
These statement are represented by triples as shown in fig . (b)
SL NO | OP | ARG1 | ARG2 |
---|---|---|---|
(0) | Uminus | B | - |
(1) | + | C | D |
(2) | * | (0) | (1) |
(3) | := | A | (2) |
Fig. (b) triple representation of three -address statements.
0 comments:
Post a Comment