COA CSE 2009 Module-2 Part-1
COA CSE 2009 Module-2 Part-1
CSE 2009
• To execute the add instruction in the figure(A) the processor uses the value B, which is
in the register R1, as the effective address of the operand. the value read is desired
operand, which the processor adds to the contents or register R0.
EA=X+[Ri]+[Rj]
this way is more useful in accessing multiple components
inside each item ( Ex: multi dimensional arrays)
Subtract #4,SP
Move NEWITEM,(SP)
These two instructions move the word from location NEWITEM onto the top of
the STACK decrementing the stack pointer before the move.
RETURN Instruction:
• The parameters may be placed in registers or in memory locations, where they can
be accessed by subroutine
efficient.
• Figure shows how the program for adding a list of numbers can be
implemented as subroutine.