1.One Address Instructions
This uses an implied ACCUMULATOR register for data manipulation. One operand is in the accumulator and the other is in the register or memory location.
Expression: x + y/(rs/t) - u
AC is accumulator
M[] is any memory location
M[T] is temporary location
LOAD rs AC = M[rs] ; AC = rs
DIV t AC = AC/t ; AC = rs/t
STORE T M[T] = AC ; T = rs/t
LOAD y AC = M[y] ; AC = y
DIV T AC = AC/T ; AC = y/(rs/t)
ADD x AC = AC + M[x] ; AC = x+ (y/(rs/t))
SUB u AC = AC + M[u] ; AC = x+ y/(rs/t) –u
2.Two Address Instructions
Here two addresses can be specified in the instruction. Unlike earlier in one address instruction, the result was stored in the accumulator, here the result can be stored at different locations rather than just accumulators, but require more number of bit to represent address.
Expression: x + y/(rs/t) - u
R1, R2 are registers
M[] is any memory location
MOV R1, rs R1 = M[rs] ; R1 = rs
DIV R1, t R1 = R1/M[t] ; R1 = rs/t
MOV R2, y R2 = M[y] ; R2 = y
DIV R2, R1 R2 = R2/R1 ; R2 = y/(rs/t)
ADD R2, M[x] R2 = R2+M[x] ; R2 = y/(rs/t) + x
SUB R2, M[u] R2 = R2 – M[u] ; R2 = x + y/(rs/t) – u
3. Three Address Instructions
This has three address field to specify a register or a memory location.
Expression: x+(x/(rs/t))-x
R1, R2 are registers
M[] is any memory location
SUB R1, x, y R1 = M[x] – M[y] ; R1 = x - u
DIV R2, rs, t R2 = M[rs]/M[t] ; R2 = rs/t
DIV R2, y, R2 R2 = y/R2 ; R2 = y/(rs/t)
ADD R1, R1, R2 R1 = R1 + R2 ; R1 = x + y/(rs/t) – u
Comments
Thank you assignment expert. You guys are the best.
Leave a comment