Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started