Chapter 11 Instruction Sets

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.
Chapter 11 Instruction Sets
Abdullah, Ibrahim Ali, Javeed Budhram, Dharmendra Galiana, Thomas Monegro, Wesley Silva, Frank.
CH11 Instruction Sets: Addressing Modes and Formats
Pentium Addressing Modes
Chapter 11 Instruction Sets: Addressing Modes and Formats HW: 11.4, 5, 13, 16 (Due 11/15)
ADDRESSING MODES OF Addressing Modes of  To perform any operation, we have to give the corresponding instructions to the microprocessor.
Processor Organization and Architecture Module III.
Instruction Set Design by Kip R. Irvine (c) Kip Irvine, All rights reserved. You may modify and copy this slide show for your personal use,
Machine Instruction Characteristics
L/O/G/O The Instruction Set Chapter 9 CS.216 Computer Architecture and Organization.
Computer Architecture and the Fetch-Execute Cycle
Execution of an instruction
26-Nov-15 (1) CSC Computer Organization Lecture 6: Pentium IA-32.
Computer Organization
ECEG-3202 Computer Architecture and Organization Chapter 6 Instruction Sets: Addressing Modes and Formats.
In1210/01-PDS 1 TU-Delft Instructions and addressing.
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:
Addressing Modes and Formats
WEEK 3 I/O Port Programming ET2640 Microprocessors and Microcontrollers.
Computer Systems – Machine & Assembly code. Objectives Machine Code Assembly Language Op-code Operand Instruction Set.
Computer Organization Instructions Language of The Computer (MIPS) 2.
Computer Architecture
İ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
Instruction sets : Addressing modes and Formats
Machine dependent Assembler Features
Overview of Instruction Set Architectures
William Stallings Computer Organization and Architecture 6th Edition
Immediate Addressing Mode
ELEN 468 Advanced Logic Design
Architecture Review Instruction Set Architecture
Alvaro Mauricio Peña Dariusz Niworowski Frank Rodriguez
A Closer Look at Instruction Set Architectures
Microcomputer Programming
William Stallings Computer Organization and Architecture 8th Edition
Asst. Prof. Dr. Gazi Erkan BOSTANCI Slides are mainly based on
Assembly Lang. – Intel 8086 Addressing modes – 1
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Computer Organization and Assembly Language (COAL)
Processor Organization and Architecture
ECE 445 CS1251 Computer Organization Carl Hamacher
BIC 10503: COMPUTER ARCHITECTURE
CS170 Computer Organization and Architecture I
Chapter 8 Central Processing Unit
Processor Organization and Architecture
ECEG-3202 Computer Architecture and Organization
Computer Architecture and the Fetch-Execute Cycle
68000 Architecture, Data Types and Addressing Modes
Introduction to Micro Controllers & Embedded System Design
Computer Architecture
Classification of instructions
CPU Structure CPU must:
CPU Structure and Function
Chapter 11 Processor Structure and function
William Stallings Computer Organization and Architecture 8 th Edition Chapter 11 Instruction Sets: Addressing Modes and Formats.
Asst. Prof. Dr. Gazi Erkan BOSTANCI Slides are mainly based on
Computer Organization
Presentation transcript:

Chapter 11 Instruction Sets Addressing Modes and Formats

10.1 Addressing Instructions is designed to be able to reference a large range of locations in main memory To achieve this objective, a variety of addressing techniques have been employed. Trade off between address range and/or the complexity of address calculation The addressing techniques are : Immediate, direct, indirect, register, register indirect, displacement, stack

Addressing Modes (a) Immediate LDA #100 (b) Direct LDA A Operand A Instruction Instruction Memory (a) Immediate LDA #100 Operand (b) Direct LDA A

Addressing Modes - continued.1 Ri Instruction Instruction Memory Registers R1 Operand (address) Ri Memory location Rn (c) Indirect LDA @A (d) Register MOV R1

Addressing Modes - continued.2 Op-code Ri Ri A Instruction Instruction Memory Memory Registers Registers R1 R1  Ri (base addr.) Operand Ri (address) Operand Rn Rn (e) Register Indirect LDA (R1) (f) Displacement LDA 100(R1)

Addressing Mode - continued.3 Instruction Implicit Top of Stack (g) Stack Stack addressing

Basic Addressing Modes EA = Effective Address A = content of the (an) address field in the instruction (X) = content of location X Principal Principal Mode Algorithm Advantage Disadvantage ------------------------------------------------------------------------------------------------- Immediate Operand = A No memory reference Limited opr. Magni. Direct EA = A Simple Limited addr. Space Indirect EA = (A) Large addr. Space Multiple mem. Ref. Register EA = R No mem. Reference Limited addr. Space Reg Indirect EA = (R) Large addr. Space Extra mem. Ref. Displacement EA = A + (R) Flexibility Complexity Stack EA = top of stack No mem. Reference Limited applicability

Addressing Mode Examples Immediate : ADD #100 ; add 100 to Accum. Direct: ADD A ; add content of addr. A to accumulator Indirect : ADD @A ; content of location A is address of operand. add content of loc. with that address to accum. Register Direct: ADD R1 ; add content of R1 to accumulator Reg. Indirect : ADD (R1) ; add content of mem. Location whose addr. is in R1 to acc.

Example - continued.1 Addressing with displacement is “rare”, but it may have an example like : ADD 1050(R1) where the base- address is the content of R1 and the displacement is 1050. In two address instruction, this may look like : ADD 1050(R1), (R2) where the base-address is in R1 and the displacement is 1050

Addressing Mode Examples - continued.1 Three common of displacement addressing : Relative addressing Base register addressing Indexing Relative addressing : Address of operand is the sum of address in the instruction plus the content of PC Op-code R1 Address of operand  PC Memory address

Addressing Mode Examples - continued.2 Base register addressing : Content of base-register is added to the operand address in the instruction Indexing : The address field of instruction, is added to content of index register to obtain the exact memory address (of the operand) The three address schemes we were just discussing, make use of a register to point to some specific segment of memory and uses the operand address in the instruction as the displacement

Pentium Addressing Modes Mode Algorithm Immediate Operand = A Register LA = R Displacement LA =(SR) + A Base LA = (SR) + (B) Base with Displacement LA = (SR) + (B) + A Scaled Index with Displacement LA = (SR) + (I)*S + A Base with Index and Displacement LA = (SR) + (B) + (I) + A Based w/ Scaled index & displacem. LA = (SR) + (I)*S +(B) +A Relative LA = (PC) + A --------------------------------------------------------------------------------------LA = Linear Address, (X) = Address of X, SR = Segment Register A = Content of address field in the instruction, B = Base register, I = Index Register, S = Scaling factor

10.2 Instruction Formats Format of instructions reflects the designer’s goal of the machine performance and flexibility Length of instruction varies, depending in the purpose. Most instructions chooses the length equal to the basic transfer information unit (word, 16 or 32 bits) Allocation of bits, usually depends on addressing modes it used. Register addressing for instance, takes less space than absolute addressing. Variable length instruction like Intel 8080 for instance, makes instruction fetch consumes another cycles Use fixed word instruction for faster fetch cycle

Program Example : unknown machine Memory Addressing addr. Label Operation or data info. ------------------------------------------------------------------------------------------ Assembler command SUM EQU 200 ORIGIN 201 N DATA 300 NUM1 DATA 301 ORIGIN 100 Statements that START MOVE R1,N generate machine MOVE R2,#NUM1 instructions CLR R0 LOOP ADD R0,(R2) INC R2 DEC R1 BGTZ LOOP MOVE SUM,R0 Assembler commands RETURN END START

Exercise Problems (1) Given the following values and a one-address machine with an accumulator,what values do the following instructions load into the accumulator? -Word 20 contains 40 -Word 40 contains 60 -Word 30 contains 50 -Word 50 contains 70 Load Immediate 20 (Load #20) Load Direct 20 (Load 20) Load Indirect 20 (Load @20) Load Direct 30 (Load 30) Load Indirect 30 (Load @30)

Exercise Problems (2) Given the following values and a one-address machine with an accumulator,what are the results of the following instructions? -Word 20 contains 40 -Word 40 contains 60 -Word 30 contains 50 -Word 50 contains 70 -R1 contains 40 -R2 contains 60 Load #20, then Store (R1) Load 20, then Add R2 Load 30, then Sub R1 Load @30, then Mul #2 Load 50, then Sub @40