Ch11.ppt - William Stallings Computer Organization and...

This preview shows page 1 - 16 out of 85 pages.

1 William Stallings Computer Organization and Architecture Chapter 11 Instruction Sets: Addressing Modes and Formats
2 Addressing Instruction Format Assembly Language
3 Addressing Modes Immediate Direct Indirect Register Register Indirect Displacement (Indexed) Stack
4 two comments need to note 1 How control unit can determine which address mode is being used in a particular instruction? Different opcodes will use different addressing modes. One or more bits in instruction format can be used as a mode field . Value of mode field determines which addressing mode is to be used.
5 two comments need to note 2 Interpretation of effective address (EA). 有效 地址 In a system without virtual memory, effective address will be either a main memory address or a register. In a virtual memory system, effective address is a virtual address or a register.
6 Process: 进程定义 A program in execution The “animated spirit” of a program That entity to which a processor is assigned virtual memory --Process
7 virtual memory -- Paging Split processes into equal sized small chunks – pages Split memory into equal sized, small chunks - page frames Allocate the required number page frames to a process A process does not require contiguous page frames
8 Free frame list 13 14 15 18 20 13 14 15 16 17 18 19 20 21 In Use In Use In Use Process A Page 0 Page 1 Page 2 Page 3 13 14 15 16 17 18 19 20 21 In Use In Use In Use Page 0 of A Page 1 of A Page 2 of A Page 3 of A Free frame list 20 Process A Page 0 Page 1 Page 2 Page 3 13 15 14 Process A Page Table Before After 18 virtual memory -- Paging
9 virtual memory Demand paging (请求分页) Do not require all pages of a process in memory, bring in pages as required So - we can now run processes that are bigger than total memory available! Main memory is called real (or physical) memory User/programmer sees much bigger memory which is allocated on the disk - virtual memory
10 Notation A = contents of an address field in the instruction R = contents of an address field in the instruction that refers to a register EA = actual address of the location containing the referenced operand (X) = contents of location X
11 Immediate Addressing Simplest form of addressing is immediate addressing , in which operand is actually present in instruction: OPERAND = A e.g. ADD 5 Add 5 to contents of accumulator 5 is operand No memory reference to fetch data Fast Limited range: size of number is restricted to size of address field
12 Immediate Addressing Diagram Operand Opcode Instruction ADD 5
13 Direct Addressing Address field contains address of operand Effective address = address field ( EA = 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
14 Direct Addressing Diagram Address A Opcode Instruction Memory Operand
15 Indirect Addressing (1) With direct addressing , length of address field is usually less than word length, thus limiting

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture