Computer Organization - Instruction Formats (Zero, One, Two and Three Address Instruction) - GeeksforGeeks
Computer Organization - Instruction Formats (Zero, One, Two and Three Address Instruction) - GeeksforGeeks
Computer Organization - Instruction Formats (Zero, One, Two and Three Address Instruction) - GeeksforGeeks
A instruction is of various length depending upon the number of addresses it contain. Generally
CPU organization are of three types on the basis of number of address fields:
In first organization operation is done involving a special register called accumulator. In second on
multiple registers are used for the computation purpose. In third organization the work on stack
basis operation due to which it does not contain any address field. It is not necessary that only a
single organization is applied a blend of various organization is mostly what we see generally.
Expression: X = (A+B)*(C+D)
Postfixed : X = AB+CD+*
TOP means top of stack
M[X] is any memory location
PUSH A TOP = A
PUSH B TOP = B
PUSH C TOP = C
PUSH D TOP = D
LOAD A AC = M[A]
ADD B AC = AC + M[B]
STORE T M[T] = AC
LOAD C AC = M[C]
ADD D AC = AC + M[D]
MUL T AC = AC * M[T]
STORE X M[X] = AC
Expression: X = (A+B)*(C+D)
R1, R2 are registers
M[] is any memory location
MOV R1, A R1 = M[A]
MOV R2, C R2 = C
ADD R2, D R2 = R2 + D
MUL R1, R2 R1 = R1 * R2
MOV X, R1 M[X] = R1
Expression: X = (A+B)*(C+D)
R1, R2 are registers
M[] is any memory location