©These slides may be freely used, distributed, and incorporated into other works. 1 Addressing Modes For speed… we want fixed-size instructions, and they.

Slides:



Advertisements
Similar presentations
Instruction Set Design
Advertisements

Goal: Write Programs in Assembly
Review of the MIPS Instruction Set Architecture. RISC Instruction Set Basics All operations on data apply to data in registers and typically change the.
ISA Issues; Performance Considerations. Testing / System Verilog: ECE385.
1 Lecture 3: Instruction Set Architecture ISA types, register usage, memory addressing, endian and alignment, quantitative evaluation.
10/9: Lecture Topics Starting a Program Exercise 3.2 from H+P Review of Assembly Language RISC vs. CISC.
CS1104 – Computer Organization PART 2: Computer Architecture Lecture 5 MIPS ISA & Assembly Language Programming.
ELEN 468 Advanced Logic Design
Chapter 2 Instructions: Language of the Computer
ITCS 3181 Logic and Computer Systems 2015 B. Wilkinson slides3.ppt Modification date: March 16, Addressing Modes The methods used in machine instructions.
Csci136 Computer Architecture II Lab#4. - Stack and Nested Procedures
331 W08.1Spring :332:331 Computer Architecture and Assembly Language Spring 2006 Week 8: Datapath Design [Adapted from Dave Patterson’s UCB CS152.
1 Registers and MAL - Part I. Motivation So far there are some details that we have ignored instructions can have different formats most computers have.
CIS429.S00: Lec6- 1 Addressing Modes There are a variety of ways a machine instruction can specify an address in memory. Effective address - the actual.
CSE378 ISA evolution1 Evolution of ISA’s ISA’s have changed over computer “generations”. A traditional way to look at ISA complexity encompasses: –Number.
CIS429/529 ISA - 1 Instruction Set Architectures Classification Addressing Modes Types of Instructions Encoding Instructions MIPS64 Instruction Set.
L5 – Addressing Modes 1 Comp 411 – Spring /29/08 Operands and Addressing Modes Where is the data? Addresses as data Names and Values Indirection.
Computer Structure - Datapath and Control Goal: Design a Datapath  We will design the datapath of a processor that includes a subset of the MIPS instruction.
Pentium Addressing Modes
Chapter 11 Instruction Sets: Addressing Modes and Formats HW: 11.4, 5, 13, 16 (Due 11/15)
CS 300 – Lecture 6 Intro to Computer Architecture / Assembly Language Instructions.
9/29: Lecture Topics Memory –Addressing (naming) –Address space sizing Data transfer instructions –load/store on arrays on arrays with variable indices.
Memory and Addressing How and Where Information is Stored.
1 (Based on text: David A. Patterson & John L. Hennessy, Computer Organization and Design: The Hardware/Software Interface, 3 rd Ed., Morgan Kaufmann,
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 +
Computer Organization and Design Addressing Modes Montek Singh Sep 30, 2015 Lecture 7.
MS108 Computer System I Lecture 3 ISA Prof. Xiaoyao Liang 2015/3/13 1.
Chapter 2 — Instructions: Language of the Computer — 1 Memory Operands Main memory used for composite data – Arrays, structures, dynamic data To apply.
Lecture 2: Instruction Set Architecture part 1 (Introduction) Mehran Rezaei.
Computer Organization Instructions Language of The Computer (MIPS) 2.
MIPS Processor.
1 What we want: execute High Level Language (HLL) programs What we have: computer hardware (a glorified calculator)
MIPS Assembly.
Immediate Addressing Mode
Chapter 11 Instruction Sets
COMPUTER ARCHITECTURE & OPERATIONS I
ELEN 468 Advanced Logic Design
Processor Architecture: Introduction to RISC Datapath (MIPS and Nios II) CSCE 230.
8051 Addressing Modes The way, using which the data source or destination addresses are specified in the instruction mnemonic for moving the data, is.
Instruction Format MIPS Instruction Set.
Computer Organization and ASSEMBLY LANGUAGE
Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*
These are slides from Comp411
MIPS Processor.
MIPS Instruction Encoding
MIPS Instruction Encoding
Computer Architecture and the Fetch-Execute Cycle
Classification of instructions
MIPS Microarchitecture Multicycle Processor
Evolution of ISA’s ISA’s have changed over computer “generations”.
Prof. Sirer CS 316 Cornell University
Overheads for Computers as Components 2nd ed.
COMS 361 Computer Organization
Instruction Format MIPS Instruction Set.
COMS 361 Computer Organization
Evolution of ISA’s ISA’s have changed over computer “generations”.
MIPS e pipelining Tecniche di base.
MIPS Coding Continued.
Evolution of ISA’s ISA’s have changed over computer “generations”.
CPU Structure CPU must:
Addressing Modes Don Porter.
Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*
9/27: Lecture Topics Memory Data transfer instructions
Evolution of ISA’s ISA’s have changed over computer “generations”.
7/6/
MIPS Processor.
Presentation transcript:

©These slides may be freely used, distributed, and incorporated into other works. 1 Addressing Modes For speed… we want fixed-size instructions, and they should be small. Fixed-size, so that 2 update PC is the one step PC  PC + single constant value Small size, so that 1 fetch instruction can be done in a single memory access.

©These slides may be freely used, distributed, and incorporated into other works. 2 A fixed-size of 32 bits is acceptable. add $4, $10, $21 add (<32)

©These slides may be freely used, distributed, and incorporated into other works. 3 What about lw $16, X ? lw 16 X (not <32) In fact, any instruction with an address is not < 32 bits.

©These slides may be freely used, distributed, and incorporated into other works. 4 The use of addressing modes offer ways of answering the question: Where is the operand? If there is no choice of addressing mode, no bits of machine code identify addressing mode. With choice, extra bits are needed. MIPS: no choice!

©These slides may be freely used, distributed, and incorporated into other works. 5 If machine code not fixed size, place address in instruction. An invented example, like the MIPS code: lw $16, X lw 16 X 6 5 effective address 32 Called direct addressing mode

©These slides may be freely used, distributed, and incorporated into other works. 66 put address in a register lw $16, ($8) Address of variable effective address lw Bits Calledregister direct (<32)

©These slides may be freely used, distributed, and incorporated into other works. 77 Add the contents of 2 registers to form an address effective address Not on MIPS! (invented for an example) lw $16, ($8)($9) lw Bits (<32)

©These slides may be freely used, distributed, and incorporated into other works. 88 Use those extra 16 bits for a constant… lw $16, 24($8) 24 + Value in $8  address effective lw bits The only addressing mode on the MIPS for load/store! Calledbase displacement

©These slides may be freely used, distributed, and incorporated into other works. 99 If operand is in a register, effective address does not make sense, but called register addressing mode So, for the MIPS instruction add $12, $13, $8 ALL 3 operands imply a register addressing mode

©These slides may be freely used, distributed, and incorporated into other works. 10 If an operand is in the instruction, called immediate mode addi $8, $9, -1 addi Bits effective address is the instruction’s address !

©These slides may be freely used, distributed, and incorporated into other works. 11 Use any “extra” bits within the instruction for a constant. Use constant as an offset: offset + PC  effective address 11

©These slides may be freely used, distributed, and incorporated into other works. 12 beq $11, $14, somewhere somewhere: # another instruction here beq1114offset offset ≈ somewhere – beq’s address called PC Relative

©These slides may be freely used, distributed, and incorporated into other works. 13 Use any “extra” bits in the instruction to hold part of an address... on MIPS: jsomewhere somewhere: # instruction here 13

©These slides may be freely used, distributed, and incorporated into other works. 14 jpart of addr = 26 bits 32 address somewhere 26 bits goes in instruction other MSBs come from PC! 14

©These slides may be freely used, distributed, and incorporated into other works. 15 memory **** //////// wonderful addressing mode that is not offered(!) any more... register indirect not on MIPS! Invented for an example: lw $8, (($9)) //////// $8 **** $9

©These slides may be freely used, distributed, and incorporated into other works. 16 RISC Reduced Instruction Set Computer  small instruction set  machine code is a fixed size (and small)  no choice of addressing modes (in the machine code)  simple instructions 16

©These slides may be freely used, distributed, and incorporated into other works. 17 CISC Complex Instruction Set Computer  often, huge instruction set (up to 256 unique instructions!)  machine code varies from one instruction to another in terms of size (example: x861 to 17 bytes!)  often lots of addressing mode choice (each operand's addressing mode is specified independent of the others!) 17

©These slides may be freely used, distributed, and incorporated into other works. 18 CISC addressing modes example VAX add13,(R4),R3 immediateregister register direct 13 + value from memory  R3 machine code: add1 byte op code 1 byte (immediate) 8 bytes 32-bit 2’s comp 1 byte (reg direct, R4) 1 byte (reg, R3) 18