MicroProcessors Lec. 3 Dr. Tamer Samy Gaafar. Course Web Page

Slides:



Advertisements
Similar presentations
Instruction Set Design
Advertisements

There are two types of addressing schemes:
Instruction Set Architecture Classification According to the type of internal storage in a processor the basic types are Stack Accumulator General Purpose.
Computer Organization and Architecture
Chapter 11 Instruction Sets
The Central Processing Unit Instruction Sets: Addressing Modes and Formats.
Instruction Set Architecture & Design
Mod-Mod Pengalamat Segera (Immediate) Terus (Direct)
CH11 Instruction Sets: Addressing Modes and Formats
Topics covered: ARM Instruction Set Architecture CSE 243: Introduction to Computer Architecture and Hardware/Software Interface.
Unit -II CPU Organization By- Mr. S. S. Hire. CPU organization.
Chapter 11 Instruction Sets: Addressing Modes and Formats HW: 11.4, 5, 13, 16 (Due 11/15)
CH12 CPU Structure and Function
Processor Organization and Architecture Module III.
Module 10 Adapted By and Prepared James Tan © 2001.
Instruction Set Architecture
COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE Lecture 15 & 16 Stacks, Endianness Addressing Modes Course Instructor: Engr. Aisha Danish.
Assembly Language Issues – Page 1CSCI 4717 – Computer Architecture CSCI 4717/5717 Computer Architecture Topic: Assembly Language Issues Reading: Stallings,
L/O/G/O The Instruction Set Chapter 9 CS.216 Computer Architecture and Organization.
Homework Problems 1. M1 runs the program P in 1.4 * 9 * ns or ns M2 runs the program P in 1.6*9800*10ns or ns Hence M2 is faster by.
Module 3 Instruction Set Architecture (ISA): ISA Level Elements of Instructions Instructions Types Number of Addresses Registers Types of Operands.
Instruction Sets: Characteristics Functions Addressing Modes Formats Chapter7:
COMPUTER ARCHITECURE INSTRUCTION SET ARCHITECTURE.
Computer Organization
Chapter 11 Instruction Sets: Addressing Modes and Formats
Computer Architecture Lecture 03 Fasih ur Rehman.
ECEG-3202 Computer Architecture and Organization Chapter 6 Instruction Sets: Addressing Modes and Formats.
Chapter 11 Instruction Sets: Addressing Modes and Formats Gabriel Baron Sydney Chow.
Instruction Sets: Addressing modes and Formats Group #4  Eloy Reyes  Rafael Arevalo  Julio Hernandez  Humood Aljassar Computer Design EEL 4709c Prof:
COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE Lecture 21 & 22 Processor Organization Register Organization Course Instructor: Engr. Aisha Danish.
Addressing Modes and Formats
WEEK 3 I/O Port Programming ET2640 Microprocessors and Microcontrollers.
What is a program? A sequence of steps
EKT 422/4 COMPUTER ARCHITECTURE SoME-0809-I 1 Chapter 3a Instruction Sets: Characteristics and Functions.
MicroProcessors Lec. 4 Dr. Tamer Samy Gaafar. Course Web Page —
1 ADDRESSING MODES Addressing Modes: * Specifies a rule for interpreting or modifying the address field of the instruction (before the operand is actually.
Computer Architecture
EEL 4709C Prof. Watson Herman Group 4 Ali Alshamma, Derek Montgomery, David Ortiz 11/11/2008.
İnformasiya texnologiyaları kafedrası Mövzu № 7. Ünvanlaşdırma üsulları. (Ünvanlaşdırma rejimləri. Bilavasitə ünvanlaşdırma. Birbaşa ünvanlaşdırma. Registrli.
Displacement (Indexed) Stack
William Stallings Computer Organization and Architecture 6th Edition
Overview Introduction General Register Organization Stack Organization
Chapter 11 Instruction Sets
Alvaro Mauricio Peña Dariusz Niworowski Frank Rodriguez
William Stallings Computer Organization and Architecture 8th Edition
Asst. Prof. Dr. Gazi Erkan BOSTANCI Slides are mainly based on
Computer Organization and Design
Processor Organization and Architecture
BIC 10503: COMPUTER ARCHITECTURE
Central Processing Unit
CENTRAL PROCESSING UNIT
Chapter 8 Central Processing Unit
Processor Organization and Architecture
ECEG-3202 Computer Architecture and Organization
Computer Architecture and the Fetch-Execute Cycle
Computer Architecture
William Stallings Computer Organization and Architecture 8 th Edition Chapter 11 Instruction Sets: Addressing Modes and Formats.
COMPUTER ORGANIZATION AND ARCHITECTURE
Asst. Prof. Dr. Gazi Erkan BOSTANCI Slides are mainly based on
Presentation transcript:

MicroProcessors Lec. 3 Dr. Tamer Samy Gaafar

Course Web Page

 Perform the following operation in BCD ( )

Addressing Modes

1.Implied or Inherent 2.Immediate 3.Direct 4.Indirect 5.Register 6.Register Indirect 7.Displacement 8.Stack

 Single Byte Instructions.  Have No Operand.  Ex. HLT  Or Operand is implied in inst.  Ex. Inc

 Address field A contains operand.  Syntax: #A  Ex.: ADD #5 ◦ AC  [AC] + 5. ◦ 5 is the operand.  No memory reference to fetch data  fast.  Limited operand magnitude.  Sign extension if loaded into a larger data register.

 Address field contains address of operand.  Address of operand  effective address (EA).  EA = A  Syntax: A  Ex.: ADD 1000 ◦ AC  [AC] + [1000]. ◦ Look in mem. at address 1000 for operand.  Single memory reference to access data.  Simple: no additional calculations to work out effective address.  Limited address space.

 EA = [A]  Syntax: (A)  Ex.: ADD (1000) ◦ AC  [AC] + [ [1000] ].  Large address space: 2 n, where n = word length.  Multiple memory references to find operand  slower.  May be nested, multilevel, cascaded ◦ Ex.: SUB (((100)))  EA = [ [ [100] ] ]  Operand = ?  Draw the diagram yourself! Address field contains address of memory location that contains address of operand.

 Address field identifies a register that holds the operand.  c.f. Direct addressing  EA = R  Notation: R  Ex.: ADD R1 AC  [AC] + [R1].  Limited number of registers.  Small address field needed (3-5 bits) ◦ Shorter instructions  Faster instn. fetch.  No memory reference  fast execution.  Very limited address space.  Multiple registers help performance ◦ Requires good assembly programming or compiler writing.

 Address field identifies register that contains the address of the operand.  c.f. Indirect addressing.  EA = [R]  Notation: (R) Ex.: ADD (R1) AC  [AC] + [ [R1] ]. Large address space (2 n ). One fewer memory access than indirect addressing.

1.Implied or Inherent 2.Immediate 3.Direct 4.Indirect 5.Register 6.Register Indirect 7.Displacement 8.Stack

 Operand described using 2 address fields: A and R.  One holds base value and the other holds displacement.  EA = A + [R]

 Relative Addressing (PC-relative) ◦ R is implicitly defined as the PC  R=PC ◦ A is the displacement; a signed number (in 2’s complement representation). ◦ Meaning: operand found A locations far from following instruction. ◦ EA = A + [PC] ◦ ◦ Ex.:  AC  [AC] + [– [PC]]. ◦ Most common usage: defining target address in (conditional) branch instructions.

 Base-Register Addressing ◦ Register R holds a base address. ◦ A is a number representing a displacement from the base address. ◦ EA = A + [R] ◦ Notation: R(A) ◦ Ex.: ADD R2(50)  AC  [AC] + [ 50 + [R2] ] ◦ R may be explicit or implicit (e.g. segment registers in 80x86). ◦ With N registers and K-bit displacement A, an instruction can reference one of N areas of 2 K words. ◦ Most common usage: implementing segmentation.

 Indexed Addressing ◦ A is a memory address. ◦ Register R holds displacement (index register). ◦ EA = A + [R] ◦ Notation: A(R) ◦ Ex.: ADD R5, 40(R3); DEC R3;  R5  [R5] + [ 40 + [R3] ]; R3  [R3] – 1 ◦ Typically, A would have more bits than it does in base-register addressing mode. ◦ Most common usage: referencing arrays.

 Autoindexing Addressing (Auto-Increment / Auto-Decrement) ◦ Typically, there is a need to increment/decrement the index register after each reference to it. ◦ EA = A + [R]; R  [R] ± 1 ◦ Notation: A(R)± ◦ Ex.: ADD R5, 40(R3) –  R5  [R5] + [ 40 + [R3] ]; R3  [R3] – 1 ◦ Most common usage: referencing arrays. ◦ If certain registers are devoted exclusively to indexing  autoindexing is done automatically.

 Preindexing / Postindexing Addressing: ◦ Sometimes both indexing and indirection are provided. ◦ Preindexing: indexing is done before indirection.  EA = [ A + [R] ]  Notation: (A(R))  Ex.: ADD R5, (200(R4))  R5  [R5] + [ [ [R4] ] ]  Common usage: implement multiway branch tables. Table starts at location A. Table is indexed by [R] to select branch target address. ◦ Postindexing: indexing is done after indirection.  EA = [A] + [R]  Notation: (A)(R)  Ex.: ADD R5, (200)(R4)  R5  [R5] + [ [200] + [R4] ]  Common usage: accessing fixed-format data blocks. A block is identified by [A]. Target element in block is identified by [R].

 Operand is (implicitly) on top of stack.  EA = [SP]  Notation: N/A  Ex.: ADD ◦ Pop top two items from stack, add them, push result back to stack [SP] + 1  [ [SP] ] + [ [SP] + 1 ]; SP  [SP] + 1

What is your notes?

Conclude the program operation?

 Text book p.56 – p.72