Intermediate Code: Three–Address Code
• Instruction in three–address code (3AC) has the form:
(o, Ea, Eb, Er)
• o – operator     (+, –, *, …)
• a – operand 1 (Ea = address of a)
• b – operand 2 (Eb = address of b)
• r – result (Er = address of r)
Examples:
(:=  ,  a,  , c ) …  c := a
(+   ,  a, b, c ) …  c := a + b
(not ,  a,  , b ) …  b := not(a)
(goto,   ,  , L1) …  goto L1
(goto,  a,  , L1) …  if a = true then goto L1
(lab , L1,  ,   ) …  label L1:
3/69