3
3
Move LOC,R1
• The contents of LOC are unchanged
by the execution of this instruction,
but the old contents of register R1 are
overwritten.
• Adding two numbers contained in
processor registers R1and R2 and
placing their sum in R3 can be
specified by the assembly
language statement
Add R1,R2,R3
BASIC INSTRUCTION TYPES
3 address instruction:-
C ← [A] + [B]
Add A,B,C
Operation Source1,Source2,Destination
two-address instructions is :-
Add A,B
(B is source & destination)
B←[A] + [B].
Operation Source,Destination
Move B,C
(copying content of B to C,
contents of location B unchanged.)
C←[B]
Therefore C←[A] + [B] can be done
in 2 steps:-
Move B,C
Add A,C
Store A
Load A
Add B
Store C
• Eg 1:
Add Ri,R j
Move Source,Destination
Eg:
Move A,Ri
or
C = A + B task can be performed by
the instruction sequence,
Move A,Ri
Move B,R j
Add Ri,R j
Move R j,C
• The speed with which a given task
is carried out depends on the time
it takes to transfer instructions
from memory into the processor
and to access the operands
referenced by these instructions.
• Transfers that involve the memory
are much slower than transfers
within the processor.