Professional Documents
Culture Documents
Operand
• EA = A
• Instruction includes the a memory address
• No calculations are required. Requires only one additional memory
reference to fetch the operand
• Address is a constant at run time but data itself can be changed during
program execution
• Provides a limited address space
Indirect Addressing
Instruction Memory
Opcode Address A
Pointer to operand
• Starts like the direct mode, but
it makes an extra memory
access. The address specified operand
in the instruction is not the
address of the operand, it is the
address of a memory location
that contains the address of the
operand.
• Two memory accesses are required
» The first to fetch the effective address
» The second to fetch the operand itself
• EA=(A)
Register Addressing
Instruction Registers
Opcode Register Address R
Operand
• EA=R
• It specifies a register instead a memory address
• No memory access
• Very fast execution
• Very limited address space
Register indirect Addressing
Instruction Registers Memory
Opcode Register Address R
Pointer to
operand
Operand
• EA = ( R )
• Register contains the address of the operand in the memory
• Register R , contains value which represents the address of
the operand in the memory
• One fewer memory access than indirect addressing
Displacement addressing
Instruction
Memory
Opcode Register R Address A
Pointer to
Operand + Operand
Registers
Top of stack
register
• The machine instructions need not include a memory reference
but implicitly operate on the top of stack.
• Stack pointer is maintained in a register, so references to stack
locations in memory are in fact register indirect addresses.
Instruction formats (1)
• An instruction is represented as a binary value with specific
format, called the instruction code
• It is made out of different groups of bits, with different
significations:
– Opcode – represents the operation to be performed (it is the
instruction identifier)
– Operands – one, two or three represent the operands of the
operation to be performed
• A microprocessor can have one format for all the
instructions or can have several different formats
• An instruction is represented by a single instruction code
Instruction formats (2)
Instruction formats (3)
• Fewer operands translates into more instructions to
accomplish the same task
• The hardware required to implement the microprocessor
becomes less complex with fewer operands;
microprocessors whose instructions specify a fewer number
of operands can execute instructions more quickly than
those that specify more operands
• The example was simplified to show the difference between
three, two, one and zero operands instructions; in practice,
the instructions require many more bits than used in these
examples; an operand field may specify an arbitrary memory
address, rather than one of the four registers; this could
require 16, 32 or even more bits per operand