Question: Compare the 0-, 1-, 2- and 3- address machines by writing programs to compute X = (A + B )/(C+D) for each of the four

Compare the 0-, 1-, 2- and 3- address machines by writing programs to compute X = (A + B )/(C+D) for each of the four machines. The instructions available for use are as follows:

0-Address 1-Address Meaning 1-address 2-Address Meaning 2-address 3-address Meaning 3-address
PUSH M LOAD M Acc [M] MOV M,N [M] [N] MOV M,N [M] [N]
POP M STORE M [M] Acc
ADD ADD M Acc Acc +[M] ADD M, N [M] [M]+[N] ADD M, N, O [M] [N]+[O]
SUB SUB M Acc Acc -[M] SUB M, N [M] [M]-[N] SUB M, N, O [M] [N]-[O]
MUL MUL M Acc Acc [M] MUL M,N [M] [M][N] MUL M, N, O [M] [N] [O]
DIV DIV M Acc Acc / [M] DIV M,N [M] [M] / [N] DIV M, N, O [M] [N] /[O]

M, N, and O are 16-bit addresses. [M] indicates the value stored at address M. SUB M, N subtracts the value stored at memory location M from N .

assume DIV (in 0-address) divide the top of the stack on the second top of the stack

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!