0% found this document useful (0 votes)
22 views

Computer Architecture

The document discusses different addressing modes used in computer architecture, including: - Implied mode where instructions implicitly specify operands. - Immediate mode where operands are specified explicitly in the instruction. - Register mode where operands are stored in registers specified in the CPU. - Register indirect mode where a register contains the address of an operand in memory. - Auto-increment/decrement mode where a register address is incremented/decremented after accessing an operand. - Direct and indirect modes where effective addresses are specified directly in instructions or located indirectly through memory.

Uploaded by

S.Ramesh raja
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Computer Architecture

The document discusses different addressing modes used in computer architecture, including: - Implied mode where instructions implicitly specify operands. - Immediate mode where operands are specified explicitly in the instruction. - Register mode where operands are stored in registers specified in the CPU. - Register indirect mode where a register contains the address of an operand in memory. - Auto-increment/decrement mode where a register address is incremented/decremented after accessing an operand. - Direct and indirect modes where effective addresses are specified directly in instructions or located indirectly through memory.

Uploaded by

S.Ramesh raja
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

II B.

Sc CS - Computer Architecture

Zero address instruction


• A stack based computer do not use address field in instruction.To evaluate a
expression first it is converted to revere Polish Notation i.e. Post fix Notation.
• Expression: X = (A+B)*(C+D)
• Postfixed : X = AB+CD+*
• TOP means top of stack. M[X] is any memory location
• Program using zero address instruction
PUSH A //TOP = A
PUSH B //TOP = B
ADD //TOP = A+B
PUSH C //TOP = C
PUSH D //TOP = D
ADD //TOP = C+D
MUL //TOP = (C+D)*(A+B)
POP X //M[X] = TOP

4. ADDRESSING MODES
• Addressing modes refers to the way in which the operand of an instruction is
specified.
• The addressing mode specifies a rule for interpreting or modifying the address
field of the instruction before the operand is actually executed.

• The purpose of using addressing modes is as follows:


- To give the programming versatility to the user.
- To reduce the number of bits in addressing field of instruction.
Types Of Addressing Mode
• Implied Mode
• Immediate Mode
• Register Mode
• Register Indirect Mode
• Auto-Increment or Auto-Decrement Mode
• Direct Mode
• Indirect Mode
• Relative Addressing Mode
• Indexed Addressing mode
• Base Register Addressing Mode

27
II B.Sc CS - Computer Architecture

Implied Mode
In this addressing mode, the instruction itself specifies the operands implicitly. It is
also called as implicit addressing mode. All register-reference instructions that make
use of the Accumulator are Implied Mode instructions.
Examples:
- The instruction “Complement Accumulator” is an implied mode instruction.
- RAL – Rotate Left with Carry
Immediate Mode
In this addressing mode, the operand is specified in the instruction explicitly.
Instead of address field, an operand field is present that contains the operand.
• Examples:
- ADD 10 will increment the value stored in the accumulator by 10.
- MOV R,20 initializes register R to a constant value 20.
Register Mode
In this mode the operand is stored in the register and this register is present in CPU.
The instruction has the address of the Register where the operand is stored.
Advantages
• Shorter instructions and faster instruction fetch.
• Faster memory access to the operand(s)
Disadvantages
• Very limited address space
• Using multiple registers helps performance but it complicates the instructions.
Register Indirect Mode
• In this mode, the instruction specifies the register whose contents give us the
address of operand which is in memory. Thus, the register contains the address
of operand rather than the operand itself.

Auto increment or auto decrement mode


Effective address of the operand is the contents of a register specified in the
instruction. After accessing the operand, the contents of the register are
automatically incremented or automatically decremented to the next consecutive
memory location. Example: Add R1, (R2)+, Add R1,-(R2)

28
II B.Sc CS - Computer Architecture

Effective Address
• The memory address of an operand consists of two components:
- Starting address of memory segment.
- Effective address or Offset: An offset is determined by adding any
combination of three address elements: displacement, base and index.
• Displacement: It is an 8 bit or 16 bit immediate value given in the instruction.
• Base: Contents of base register, BX or BP.
• Index: Content of index register SI or DI.
Direct Addressing Mode
• In this mode, effective address of operand is present in instruction itself. Single
memory reference to access data.No additional calculations to find the effective
address of the operand.
Example: ADD R1, 4000 - In this the 4000 is effective address of operand.

Indirect Addressing Mode


• In this, the address field of instruction gives the address where the effective
address is stored in memory. This slows down the execution, as this includes
multiple memory lookups to find the operand.

29

You might also like