Armando Haedo Edwin Campos Marc Latortue. Chapter 11 Instruction Sets: Addressing Modes and Formats

Similar documents
Computer Organization and Architecture

Instruction Set Architecture (ISA)

Advanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2

Central Processing Unit (CPU)

LSN 2 Computer Processors

Instruction Set Architecture. or How to talk to computers if you aren t in Star Trek

Overview. CISC Developments. RISC Designs. CISC Designs. VAX: Addressing Modes. Digital VAX

CHAPTER 7: The CPU and Memory

İSTANBUL AYDIN UNIVERSITY

ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-12: ARM

Intel 8086 architecture


Instruction Set Design

CPU Organization and Assembly Language

MICROPROCESSOR AND MICROCOMPUTER BASICS

An Introduction to the ARM 7 Architecture

a storage location directly on the CPU, used for temporary storage of small amounts of data during processing.

(Refer Slide Time: 00:01:16 min)

Computer Architecture Lecture 2: Instruction Set Principles (Appendix A) Chih Wei Liu 劉 志 尉 National Chiao Tung University

Chapter 5 Instructor's Manual

Computer Architecture Lecture 3: ISA Tradeoffs. Prof. Onur Mutlu Carnegie Mellon University Spring 2013, 1/18/2013

Instruction Set Architecture

Processor Architectures

Chapter 2 Topics. 2.1 Classification of Computers & Instructions 2.2 Classes of Instruction Sets 2.3 Informal Description of Simple RISC Computer, SRC

EC 362 Problem Set #2

COMPUTER ORGANIZATION AND ARCHITECTURE. Slides Courtesy of Carl Hamacher, Computer Organization, Fifth edition,mcgrawhill

Chapter 1 Computer System Overview

An Overview of Stack Architecture and the PSC 1000 Microprocessor

what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored?

612 CHAPTER 11 PROCESSOR FAMILIES (Corrisponde al cap Famiglie di processori) PROBLEMS

1 Classical Universal Computer 3

1 The Java Virtual Machine

MICROPROCESSOR. Exclusive for IACE Students iacehyd.blogspot.in Ph: /422 Page 1

l C-Programming l A real computer language l Data Representation l Everything goes down to bits and bytes l Machine representation Language

Lecture 7: Machine-Level Programming I: Basics Mohamed Zahran (aka Z)

Week 1 out-of-class notes, discussions and sample problems

Outline. Lecture 3. Basics. Logical vs. physical memory physical memory. x86 byte ordering

CS101 Lecture 26: Low Level Programming. John Magee 30 July 2013 Some material copyright Jones and Bartlett. Overview/Questions

The Design of the Inferno Virtual Machine. Introduction

The AVR Microcontroller and C Compiler Co-Design Dr. Gaute Myklebust ATMEL Corporation ATMEL Development Center, Trondheim, Norway

Property of ISA vs. Uarch?

How It All Works. Other M68000 Updates. Basic Control Signals. Basic Control Signals

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC Microprocessor & Microcontroller Year/Sem : II/IV

Central Processing Unit

VLIW Processors. VLIW Processors

Chapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

Administrative Issues

Instruction Set Architecture (ISA) Design. Classification Categories

IA-64 Application Developer s Architecture Guide

Computer organization

CISC, RISC, and DSP Microprocessors

MACHINE ARCHITECTURE & LANGUAGE

MACHINE INSTRUCTIONS AND PROGRAMS

Addressing The problem. When & Where do we encounter Data? The concept of addressing data' in computations. The implications for our machine design(s)

Comp 255Q - 1M: Computer Organization Lab #3 - Machine Language Programs for the PDP-8

M A S S A C H U S E T T S I N S T I T U T E O F T E C H N O L O G Y DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE

Pentium vs. Power PC Computer Architecture and PCI Bus Interface

ELE 356 Computer Engineering II. Section 1 Foundations Class 6 Architecture

PROBLEMS (Cap. 4 - Istruzioni macchina)

In the Beginning The first ISA appears on the IBM System 360 In the good old days

Generations of the computer. processors.

Computer Architectures

Microprocessor & Assembly Language

Chapter 7D The Java Virtual Machine

ARM Microprocessor and ARM-Based Microcontrollers

Chapter 4 Lecture 5 The Microarchitecture Level Integer JAVA Virtual Machine

GUJARAT TECHNOLOGICAL UNIVERSITY, AHMEDABAD, GUJARAT. COURSE CURRICULUM COURSE TITLE: COMPUTER ORGANIZATION AND ARCHITECTURE (Code: )

Interpreters and virtual machines. Interpreters. Interpreters. Why interpreters? Tree-based interpreters. Text-based interpreters

Computer Architecture TDTS10

CPU Organisation and Operation

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

Exception and Interrupt Handling in ARM

Operating System Overview. Otto J. Anshus

Application Note 195. ARM11 performance monitor unit. Document number: ARM DAI 195B Issued: 15th February, 2008 Copyright ARM Limited 2007

Chapter 2 Logic Gates and Introduction to Computer Architecture

PROGRAMMING CONCEPTS AND EMBEDDED PROGRAMMING IN C, C++ and JAVA: Lesson-4: Data Structures: Stacks

MICROPROCESSOR BCA IV Sem MULTIPLE CHOICE QUESTIONS

Intel Pentium 4 Processor on 90nm Technology

Operating Systems. Virtual Memory

Pitfalls of Object Oriented Programming

PROBLEMS #20,R0,R1 #$3A,R2,R4

Microprocessor and Microcontroller Architecture

2

CHAPTER 4 MARIE: An Introduction to a Simple Computer

The Quest for Speed - Memory. Cache Memory. A Solution: Memory Hierarchy. Memory Hierarchy

A s we saw in Chapter 4, a CPU contains three main sections: the register section,

The Java Virtual Machine and Mobile Devices. John Buford, Ph.D. Oct 2003 Presented to Gordon College CS 311

Chapter 01: Introduction. Lesson 02 Evolution of Computers Part 2 First generation Computers

Design Cycle for Microprocessors

ARM Architecture. ARM history. Why ARM? ARM Ltd developed by Acorn computers. Computer Organization and Assembly Languages Yung-Yu Chuang

361 Computer Architecture Lecture 14: Cache Memory

Computer Architecture Basics

Intel 64 and IA-32 Architectures Software Developer s Manual

2) Write in detail the issues in the design of code generator.

Bindel, Spring 2010 Applications of Parallel Computers (CS 5220) Week 1: Wednesday, Jan 27

Stack Allocation. Run-Time Data Structures. Static Structures

Keil C51 Cross Compiler

A3 Computer Architecture

Stack machines The MIPS assembly language A simple source language Stack-machine implementation of the simple language Readings:

ASSEMBLY LANGUAGE PROGRAMMING (6800) (R. Horvath, Introduction to Microprocessors, Chapter 6)

Transcription:

Armando Haedo Edwin Campos Marc Latortue Chapter 11 Instruction Sets: Addressing Modes and Formats

Immediate Direct Indirect Register Register Indirect Displacement (Indexed) Stack

Simplest form of addressing because Operand is present in 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

Opcode Instruction Operand Advantage No memory reference besides instruction fetch is required Disadvantage Size of the number is restricted to the size of the address field

Operand address is in the address field 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 Downside is limited address space

Opcode Instruction Address A Memory Operand

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. ADD (A) Add contents of cell pointed to by contents of A to accumulator

Advantage Large address space 2 n where n = word length May be nested, multilevel, cascaded e.g. EA = ( (A) ) Multiple memory accesses to find operand Disadvantage Hence slower

Opcode Instruction Address A Memory Pointer to operand Operand

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

No memory access Very fast execution Very limited address space Multiple registers helps performance Requires good assembly programming or compiler writing

Opcode Instruction Register Address R Registers Operand

EA = (R) Operand is in memory cell pointed to by contents of register R Large address space (2 n ) One fewer memory access than indirect addressing

Opcode Instruction Register Address R Memory Registers Pointer to Operand Operand

EA = A + (R) Address field hold two values A = base value R = register that holds displacement or vice versa

Opcode Register R Instruction Address A Memory Registers Pointer to Operand + Operand

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 c.f locality of reference & cache usage

A holds displacement R holds pointer to base address R may be explicit or implicit e.g. segment registers in 80x86

A = base R = displacement EA = A + R Good for accessing arrays EA = A + R R++

Postindex EA = (A) + (R) Preindex EA = (A+(R))

Operand is (implicitly) on top of stack e.g. ADD Pop top two items from stack and add A.k.a. last-in-first-out queue

Virtual or effective address is offset into segment Starting address plus offset gives linear address This goes through page translation if paging enabled 12 addressing modes available Immediate Register operand Displacement Base Base with displacement Scaled index with displacement Base with index and displacement Base scaled index with displacement Relative

Based on Intel 8086 processor in 1978 which was full 16-bit design Initial design of x86 processors were designed to be backwards compatible Source of most personal computers and embedded systems Wordsize has been extended twice to 32 and 64 bits Originally referred to as the i386 architecture Most commercially successful for personal computing

Variable instruction length, primary two address design Byte-addressing supported Words stored in little-endian order Segment registers (raised memory address limits by 4 bits) Dedicated floating point unit and SIMD (Single Instruction Multiple Data)

SIMD and floating point unit have instructions working in parallel on one or two 128 bit words Each word containing 2 or 4 floating point numbers Wide SIMD registers allow x86 processors to load or store 128 bits of memory data into 1 instruction Most registers expressed in opcodes with 3 bits to save encoding space At most 1 operand can be a memory location May also be destination while others can be register or immediate Efficient in instructing cache memory Register-related addressing in referencing operands, especially in stack applications has made the x86 instructions faster and very essential to today s computing needs

CISC Design (Complex Instruction Set Computer) Basically means that each set of instructions can execute multiple low-level operations/commands per instruction Low-Level Operations are: Load from memory, arithmetic operation, memory storage Newer x86 processors typically decode and separate instructions into sequences of internal micro operations Benefits: Execute larger subset of instructions, easier to extract parallelism out of code, offers higher performance in multi aspects

Floating point unit MMX 3DNow! SSE (Streaming SIMD Extensions) Physical Address Extension (PAE) Virtualization Support

Virtual or effective address is offset into segment Starting address plus offset gives linear address This goes through page translation if paging enabled 12 addressing modes available Immediate Register operand Displacement Base Base with displacement Scaled index with displacement Base with index and displacement Base scaled index with displacement Relative

Immediate: Operand is included in the instruction Register Operand: Operand is located in a register Displacement: The offset of the operand is part of the instruction as 8-,16- or 32-bit displacement Base: One of 8-,16-, or 32-bit registers contains the effective address Base with Displacement: The instruction contains a displacement to be added to base register

Scaled Index with Displacement: The instruction includes a displacement which is added to the index register Base with Index and Displacement: Adds the contents of the base and index registers with the displacement to form the effective address Based Scale Index with Displacement: Adds the contents of the index register and multiplies a scaling factor, contents of base register, and displacement Relative: Displacement is added to PC which points to next instruction

Only instructions that reference memory Indirectly through base register plus offset Offset Offset added to or subtracted from base register contents to form the memory address Preindex Memory address is formed as for offset addressing Memory address also written back to base register So base register value incremented or decremented by offset value Postindex Memory address is base register value Offset added or subtracted Result written back to base register Base register acts as index register for preindex and postindex addressing Offset either immediate value in instruction or another register If register scaled register addressing available Offset register value scaled by shift operator Instruction specifies shift size

Data Processing Register addressing Value in register operands may be scaled using a shift operator Or mixture of register and immediate addressing Branch Immediate Instruction contains 24 bit value Shifted 2 bits left On word boundary Effective range +/-32MB from PC.

Load/store subset of general-purpose registers 16-bit instruction field specifies list of registers Sequential range of memory addresses Increment after, increment before, decrement after, and decrement before Base register specifies main memory address Incrementing or decrementing starts before or after first memory access

Layout of bits in an instruction Includes opcode Includes (implicit or explicit) operand(s) Usually more than one instruction format in an Usually more than one instruction format in an instruction set

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

Number of addressing modes Number of operands Register versus memory Number of register sets Address range Address granularity

Stallings chapter 11 Intel and ARM Web sites

1. How many addressing modes are there and name them? Seven: Immediate, Direct, Indirect, Register, Register Indirect, Displacement and Stack 2. Match the Addressing: Register Indirect Displacement EA=( (A) ) EA= (R) Indirect EA = A + (R)

3. Define displacement addressing? This instruction has two address fields, at least one of which is explicit. The value contained in one address field (value = A) is used directly. The other address field refers to a register whose contents are added to A to produce the effective address. 4. After what processor was the x86 Instruction Set named after? Intel 8086 5. TRUE or FALSE: Base with index and displacement is an addressing mode related to the x86 instruction set? True

6. In the immediate addressing mode, what is included in the instruction? The Operand 7. TRUE or FALSE: The x86 wordsize has been extended three times, 32, 64, and 128 bits. False 8. What principle is behind the independence of the other elements in an instruction set from the opcode? Orthoganality 9. In the VAX instruction set Design operands were required to have the same what? Generality in specification

http://en.wikipedia.org/wiki/x86 http://www.arl.wustl.edu/~lockwood/class/ cs306/books/artofasm/chapter_6/ch06-1.html http://en.wikipedia.org/wiki/complex_instr uction_set_computer