Comparing Address Machines
November 13th, 2022
Compare zero-, one-, two-, and three-address machines by writing programs to compute
X = (A+B X C)/D – E X F)
For each of the four machines. The instructions available for use as follows:
0 Address 1 Address 2 Address 3 Address
PUSH M LOAD M MOVE (X<– Y) MOVE (X <–Y)
POP STORE M ADD (X<–X +Y) ADD (X<– Y +Z)
ADD ADD M SUB (X<– X -Y) SUB (X<– Y -Z)
SUB SUB M MUL (X<– X x Y) MUL (X<– Y x Z)
MUL MUL M DIV (X<– X /Y) DIV (X<– Y /Z)
DIV DIV M
Legend: <– arrow
small x multiply