chap11 - William Stallings Computer Organization and...

Info iconThis preview shows pages 1–14. Sign up to view the full content.

View Full Document Right Arrow Icon
William Stallings Computer Organization and Architecture Chapter 11 Instruction Sets: Addressing Modes and Formats
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Review Instruction:    OP  operand operand Assume,  size of memory = 2 32 Goal: You can reference a large range of locations in  memory or virtual memory in short instructions Questions? Length  of instruction: fixed or variable size? Sizes  of OP and operands? OP P 1 2 2 ?
Background image of page 2
W&   ` Ł w¶ “ , s=2*pi*R  p=&i; j=*p+j C=A*B ( ) Memory CPU Bus I/O program data data ALU Control unit registers data cache data 2 32 8 5 19 0 31 load $R 0 , pi mpy $R 0 , #2 ……
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Addressing Modes OP   operand1       operand2 Immediate add $R,  #2 ; Register add  $R , Pi ; h ª w¶ “ Direct add $R,  Pi Indirect add $R,  (P) Register Indirect add $R,   ($R 2 ) Displacement add $R,  $R b (10)
Background image of page 4
Immediate Addressing Operand is part of instruction Operand = address field e.g. ADD  5 Add 5 to contents of accumulator 5 is operand No memory reference  to fetch data Fast Limited range ADD $R1, # 5 m V v m V v ?
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Immediate Addressing Diagram Operand Opcode Instruction Operand Opcode $Ri One address: Two address: P P ( Effective address ) ( P ) P
Background image of page 6
Direct Addressing Address field contains  address  of operand Effective address  (EA) = address field (A) e.g.  ADD  A Add contents of cell A to accumulator Look in memory at address A for operand Single memory reference  to access data No additional calculations to work out effective  address Limited address space ADD $R1, A
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Direct Addressing Diagram Address A Opcode Instruction Memory Operand Address A Opcode $Ri or A
Background image of page 8
Example HX v ¶ “ 2 & & int i, j, *p; i=3; j=3; p=&i; j=*p+j H x v ¶ “ *
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Indirect Addressing (1) Memory cell  pointed to by address field  contains   the  address  of (pointer to) the operand EA = (A) Look in A, find address (A) and look there for operand e.g.  1. ADD  (A) Add  contents of cell pointed to by contents of A  to   accumulator 2. ADD $R1, (A) 3. MOV AX, [BP] v v ?
Background image of page 10
Indirect Addressing Diagram Address A Opcode Instruction Memory Operand Pointer to operand V v A P < 32 2 32 2
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Indirect Addressing (2) Large address space   2 n  where n = word length May be nested, multilevel, cascaded e.g. EA = (((A))) Draw the diagram yourself Multiple memory accesses to find operand Hence  slower
Background image of page 12
Register Addressing (1) Operand is held in register named in address  filed EA = R Limited number of registers Very  small address field  needed  Shorter instructions Faster instruction fetch ADD   $R1 , A
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 14
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 51

chap11 - William Stallings Computer Organization and...

This preview shows document pages 1 - 14. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online