Writing programs to compute x


Compare zero-, one-, two-, and three- address machines by writing programs to computeX = (A + B)2/(3C ? D)for each of the four machines. Do not modify the values of A, B, C, or D. As needed, use a temporary location T to store the intermediate results. Remember that location X is also available for intermediate results. For full credit, do not use any other memory locations. I will give a small bonus if you compute A+B only once for a given machine.The instructions available for use are as follows (M can be a variable or immediate operand):
0 Address 1 Address 2 Address 3 AddressPUSH M LOAD M MOVE (XßY) MOVE (XßY)POP M 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 × Y) MUL (XßY × Z)MUL MUL M DIV (XßX / Y) DIV (XßY / Z)DIV DIV M
Your program (add lines to the table, as needed).
0 Address 1 Address 2 Address 3 Address

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Writing programs to compute x
Reference No:- TGS0105097

Expected delivery within 24 Hours