Three address code
|
In computer science, three address code is a form of representing intermediate code used by compilers to aid in the implementation of code-improving transformations.
Each statement has the general form of
where x, y and z are variables, constants or temporary variables generated by the compiler. op represents any operator, e.g. an arithmetic operator.
Expressions containing more than one fundamental operation, such as
are not representable in three address code as a single instruction. Instead, they are decomposed into an equivalent series of instructions, i.e.,
<math>t_1 := y \times z\,<math>
<math>p := x + t_1\,<math>
The term three address code is still used even if some instructions use more or less than two operands. The key features of three address code are that every instruction implements exactly one fundamental operation, and that the source and destination may refer to any available register.
A refinement of three address code is Static single assignment form.