1 (Based on text: David A. Patterson & John L. Hennessy, Computer Organization and Design: The Hardware/Software Interface, 3 rd Ed., Morgan Kaufmann,

Slides:



Advertisements
Similar presentations
Henk Corporaal TUEindhoven 2011
Advertisements

Review of the MIPS Instruction Set Architecture. RISC Instruction Set Basics All operations on data apply to data in registers and typically change the.
1 Lecture 3: Instruction Set Architecture ISA types, register usage, memory addressing, endian and alignment, quantitative evaluation.
1 ECE462/562 ISA and Datapath Review Ali Akoglu. 2 Instruction Set Architecture A very important abstraction –interface between hardware and low-level.
1 ECE369 ECE369 Chapter 2. 2 ECE369 Instruction Set Architecture A very important abstraction –interface between hardware and low-level software –standardizes.
CS1104 – Computer Organization PART 2: Computer Architecture Lecture 5 MIPS ISA & Assembly Language Programming.
ELEN 468 Advanced Logic Design
CSE 340 Computer Architecture Spring 2014 MIPS ISA Review
Lec 9Systems Architecture1 Systems Architecture Lecture 9: Assemblers, Linkers, and Loaders Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan Some.
1 Instructions: Language of the Machine More primitive than higher level languages e.g., no sophisticated control flow Very restrictive e.g., MIPS Arithmetic.
MIPS Architecture CPSC 321 Computer Architecture Andreas Klappenecker.
1 CSE SUNY New Paltz Chapter 3 Machine Language Instructions.
RISC Concepts, MIPS ISA and the Mini–MIPS project
1  1998 Morgan Kaufmann Publishers Chapter 3 Text in blue is by N. Guydosh Updated 1/27/04 Instructions: Language of the Machine.
Computer Architecture - The Instruction Set The Course’s Goals  To be interesting and fun. An interested student learns more.  To answer questions that.
CIS 314 : Computer Organization Lecture 1 – Introduction.
1  2004 Morgan Kaufmann Publishers Chapter 2. 2  2004 Morgan Kaufmann Publishers Instructions: Language of the Machine We’ll be working with the MIPS.
ECE 232 L5 Assembl.1 Adapted from Patterson 97 ©UCBCopyright 1998 Morgan Kaufmann Publishers ECE 232 Hardware Organization and Design Lecture 5 MIPS Assembly.
S. Barua – CPSC 440 CHAPTER 5 THE PROCESSOR: DATAPATH AND CONTROL Goals – Understand how the various.
9/29: Lecture Topics Memory –Addressing (naming) –Address space sizing Data transfer instructions –load/store on arrays on arrays with variable indices.
1  2004 Morgan Kaufmann Publishers Instructions: bne $t4,$t5,Label Next instruction is at Label if $t4≠$t5 beq $t4,$t5,Label Next instruction is at Label.
순천향대학교 정보기술공학부 이 상 정 1 2. Instructions: Language of the Computer.
1 CS/EE 362 Hardware Fundamentals Lecture 10 (Chapter 3: Hennessy and Patterson) Winter Quarter 1998 Chris Myers.
1. 2 Instructions: Words of the language understood by CPU Instruction set: CPU’s vocabulary Instruction Set Architecture (ISA): CPU’s vocabulary together.
1  1998 Morgan Kaufmann Publishers Machine Instructions: Language of the Machine Lowest level of programming, control directly the hardware Assembly instructions.
6.S078 - Computer Architecture: A Constructive Approach Introduction to SMIPS Li-Shiuan Peh Computer Science & Artificial Intelligence Lab. Massachusetts.
April 23, 2001Systems Architecture I1 Systems Architecture I (CS ) Lecture 9: Assemblers, Linkers, and Loaders * Jeremy R. Johnson Mon. April 23,
1 Copyright 1998 Morgan Kaufmann Publishers, Inc. All rights reserved. MIPS Assembly language In computer programs we have : Data Instructions (Arithmetic.
Lec 15Systems Architecture1 Systems Architecture Lecture 15: A Simple Implementation of MIPS Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan Some.
Computer Architecture (CS 207 D) Instruction Set Architecture ISA.
Oct. 25, 2000Systems Architecture I1 Systems Architecture I (CS ) Lecture 9: Alternative Instruction Sets * Jeremy R. Johnson Wed. Oct. 25, 2000.
Small constants are used quite frequently (50% of operands) e.g., A = A + 5; B = B + 1; C = C - 18; Solutions? Why not? put 'typical constants' in memory.
 1998 Morgan Kaufmann Publishers MIPS arithmetic All instructions have 3 operands Operand order is fixed (destination first) Example: C code: A = B +
CS 211: Computer Architecture Lecture 2 Instructor: Morris Lancaster.
Computer Organization Rabie A. Ramadan Lecture 3.
EE472 – Spring 2007P. Chiang, with Slide Help from C. Kozyrakis (Stanford) ECE472 Computer Architecture Lecture #3—Oct. 2, 2007 Patrick Chiang TA: Kang-Min.
MIPS Instructions Instructions: Language of the Machine
DR. SIMING LIU SPRING 2016 COMPUTER SCIENCE AND ENGINEERING UNIVERSITY OF NEVADA, RENO Session 7, 8 Instruction Set Architecture.
Lecture 2: Instruction Set Architecture part 1 (Introduction) Mehran Rezaei.
Instruction Set Architecture Chapter 3 – P & H. Introduction Instruction set architecture interface between programmer and CPU Good ISA makes program.
1  1998 Morgan Kaufmann Publishers Instructions: Language of the Machine More primitive than higher level languages e.g., no sophisticated control flow.
May 22, 2000Systems Architecture I1 Systems Architecture I (CS ) Lecture 14: A Simple Implementation of MIPS * Jeremy R. Johnson Mon. May 17, 2000.
CHAPTER 2 Instruction Set Architecture 3/21/
1 CHAPTER 1 COMPUTER ABSTRACTIONS AND TECHNOLOGY Parts of these notes have been adapter from those of Prof. Professor Mike Schulte, Prof. D. Patterson,
Computer Architecture & Operations I
Computer Architecture & Operations I
Computer Architecture & Operations I
Computer Architecture Instruction Set Architecture
MIPS Instruction Set Advantages
Instruction Set Architecture
Computer Architecture Instruction Set Architecture
Instructions: Language of the Computer
ELEN 468 Advanced Logic Design
RISC Concepts, MIPS ISA Logic Design Tutorial 8.
An example of multiplying two numbers A = A * B;
Computer Architecture (CS 207 D) Instruction Set Architecture ISA
ECE/CS 552: Instruction Sets – MIPS
Instructions - Type and Format
Lecture 4: MIPS Instruction Set
Henk Corporaal TUEindhoven 2010
MIPS Instruction Encoding
ECE232: Hardware Organization and Design
Rocky K. C. Chang 6 November 2017
MIPS Instruction Encoding
Systems Architecture I
MIPS Microarchitecture Multicycle Processor
Computer Architecture
Processor: Multi-Cycle Datapath & Control
Machine Instructions.
9/27: Lecture Topics Memory Data transfer instructions
Presentation transcript:

1 (Based on text: David A. Patterson & John L. Hennessy, Computer Organization and Design: The Hardware/Software Interface, 3 rd Ed., Morgan Kaufmann, 2007) Instructions - Addressing Modes

2 COURSE CONTENTS Introduction è Instructions Computer Arithmetic Performance Processor: Datapath Processor: Control Pipelining Techniques Memory Input/Output Devices

3 Overview of MIPS Simple instructions all 32 bits wide Very structured, no unnecessary baggage Only three instruction formats Addresses are not 32 bits How do we handle this with load and store instructions op rs rt rdshamtfunct op rs rt 16 bit address op 26 bit address RIJRIJ

4 Addresses in Branches and Jumps Instructions: bne $t4,$t5,Label Next instruction is at Label if $t4 ≠ $t5 beq $t4,$t5,Label Next instruction is at Label if $t4=$t5 j Label Next instruction is at Label Formats: op rs rt 16 bit address op 26 bit address IJIJ

5 Addresses in Branches Instructions: bne $t4,$t5,Label Next instruction is at Label if $t4 ≠ $t5 beq $t4,$t5,Label Next instruction is at Label if $t4=$t5 Formats: Could specify a register (like lw and sw) and add it to address Use Instruction Address Register (PC = program counter) Most branches are local (principle of locality) Jump instructions just use high order bits of PC Address boundaries of 256 MB op rs rt 16 bit address I

6 Addressing Modes Register addressing Register addressing operand is in a register, e.g. add $s1, $s2, $s3 Base or displacement addressing Base or displacement addressing operand at memory location [register + constant (base)] e.g. 2nd operand in lw $t0, 200($s1) Immediate addressing Immediate addressing operand is a constant within instruction e.g. 3rd operand in addi $s1, $s2, 10 PC-relative addressing PC-relative addressing address = PC (+4) + constant in instruction (*4) e.g. 3rd operand in bne $s0, $s1, Exit Pseudodirect addressing Pseudodirect addressing address = PC upper bits concatenated with 26-bit address in inst.

7 Addressing Modes

8

9 Other Issues MIPS assembler accepts this pseudoinstruction even though it is not found in MIPS architecture: move $t0, $t1 #$t0  $t1 it translates it to: add $t0, $zero, $t1 Other pseudoinstructions: mult, blt, bge, etc. Assembler keeps track of addresses of labels in symbol table Details of assembler, linker, & loader are given in Appendix A Details of MIPS instruction set & architecture in Appendix A % frequency of instruction execution

10 Instruction Set Architecture Classes Use of accumulator (a default register): 1 address instruction; e.g. add A: acc  acc + mem[A] e.g. EDSAC, IBM 701, DEC PDP-8, MC 6800, Intel 8008 Use of stack: 0 address instruction; e.g. add: top(stack)  top(stack) + next_top(stack) Use of general purpose registers: 2 address instruction; e.g. add A, B:A  A + B 3 address instruction; e.g. add A,B,C:A  B + C load/store (reg/reg): e.g. MIPS, Sun’s SPARC, MC PowerPC, DEC Alpha memory/memory: e.g. DEC VAX memory/register: e.g. DEC VAX, IBM 360, DEC PDP-11, MC 68000, Intel 80386

11 RISC vs. CISC RISC -- Reduced Instruction Set Computer -- philosophy (instruction sets measured by how well compilers used them) fixed instruction lengths load/store instruction sets all operands of ALU instructions are in registers limited addressing modes limited operations e.g. MIPS, Sun SPARC, HP PA-RISC, PowerPC (AIM), ARM, Renesas Tech. SuperH (by Hitachi), ARM/Thumb, etc. CISC – Complex Instruction Set Computer -- Implies fewer instructions in the set larger register file longer programs good for pipelining simpler control

12 Chapter Summary Instruction Type Instruction Format RISC Design Principles Assembly vs. Machine Language Addressing Modes Classes of Instruction Set Architecture RISC vs. CISC