Instruction Sets 3 - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

Instruction Sets 3

Description:

Add contents of cell A to accumulator. Look in memory at address A for ... Requires good assembly programming or compiler writing. Register Addressing Diagram ... – PowerPoint PPT presentation

Number of Views:25
Avg rating:3.0/5.0
Slides: 20
Provided by: depl
Category:
Tags: instruction | jeux | sets

less

Transcript and Presenter's Notes

Title: Instruction Sets 3


1
Instruction Sets 3
  • Lecture 10
  • Ref Ch 11

2
Outline
  • Review
  • Addressing Modes
  • Instruction Formats
  • Pentium vs PowerPC

3
Immediate Addressing Diagram
Instruction
Operand
Opcode
  • ADD 5
  • Add 5 to contents of accumulator
  • 5 is operand

4
Direct Addressing Diagram
Instruction
Memory
Address A
Opcode
Operand
  • ADD A
  • Add contents of cell A to accumulator
  • Look in memory at address A for operand

5
Indirect Addressing
  • Large address space
  • 2n where n word length
  • May be nested, multilevel, cascaded
  • e.g. EA (((A)))
  • Draw the diagram yourself
  • Multiple memory accesses to find operand

6
Indirect Addressing Diagram
Instruction
Address A
Opcode
Memory
Pointer to operand
Operand
  • ADD (A)

7
Register Addressing
  • EA R
  • No memory access
  • Very fast execution
  • Very limited address space
  • Multiple registers helps performance
  • Requires good assembly programming or compiler
    writing

8
Register Addressing Diagram
Instruction
Register Address R
Opcode
9
Register Indirect Addressing
  • EA (R)
  • Operand is in memory cell pointed to by contents
    of register R
  • Large address space (2n)
  • One fewer memory access than indirect addressing

10
Register Indirect Addressing Diagram EA (R)
Instruction
Register Address R
Opcode
Memory
Registers
Operand
Pointer to Operand
11
Displacement Addressing
  • EA A (R)
  • Address field holds two values
  • A base value
  • R register that holds displacement
  • or vice versa

12
Displacement Addressing Diagram EA A (R)
13
Displacement Addressing -Relative Addressing
  • A version of displacement addressing
  • R Program counter, PC
  • EA A (PC)
  • i.e. get operand from A cells from current
    location pointed to by PC

14
Displacement Addressing - Base-Register Addressing
  • A holds displacement
  • R holds pointer to base address
  • R may be explicit or implicit
  • e.g. segment registers in 80x86

15
Displacement Addressing - Indexed Addressing
  • A base
  • R displacement
  • EA A R
  • Good for accessing arrays
  • EA A R
  • R

16
Stack Addressing
  • Operand is (implicitly) on top of stack
  • e.g.
  • ADD Pop top two items from stack and add
  • Pentium vs PowerPC Addressing Modes - See Tables
    11.2 and 11.3

17
Instruction Length
  • Affected by and affects
  • Memory size
  • Memory organization
  • Bus structure
  • CPU complexity
  • CPU speed
  • Trade off between powerful instruction repertoire
    and saving space

18
Allocation of Bits
  • Number of addressing modes
  • Number of operands
  • Register versus memory
  • Number of register sets
  • Address range
  • Address granularity
  • Examples Figures 11.8 (Pentium) and 11.9
    (PowerPC)

19
Reading
  • Capt /Sect 12.1-12.3
Write a Comment
User Comments (0)
About PowerShow.com