L2 Instructions_1_ - Topic 2 MIPS Instruction Set -...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Topic 2 MIPS Instruction Set - Operations and Operands
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Chapter 2 — Instructions: Language of the Computer — 2 Instruction Set ± All instructions of a computer ± Different computers have different instruction sets ± But with many aspects in common ± Early computers had very simple instruction sets ± Simplified implementation ± Many modern computers also have simple instruction sets
Background image of page 2
Chapter 2 — Instructions: Language of the Computer — 3 The MIPS Instruction Set ± Used as the example throughout the book ± Stanford MIPS commercialized by MIPS Technologies ( www.mips.com ) ± Large share of embedded core market ± Applications in consumer electronics, network/storage equipment, cameras, printers, … ± Typical of many modern ISAs ± See MIPS Reference Data tear-out card, and Appendixes B and E
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Chapter 2 — Instructions: Language of the Computer — 4 Levels of Program Code ± High-level language ± Level of abstraction closer to problem domain ± Provides for productivity and portability ± Assembly language ± Textual representation of instructions ± Hardware representation ± Binary digits (bits) ± Encoded instructions and data
Background image of page 4
Chapter 2 — Instructions: Language of the Computer — 5 Arithmetic Operations ± Add and subtract, three operands ± Two sources and one destination add a, b, c # a gets b + c ± All arithmetic operations have this form ± Design Principle 1: Simplicity favors regularity ± Regularity makes implementation simpler ± Simplicity enables higher performance at lower cost
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Chapter 2 — Instructions: Language of the Computer — 6 Arithmetic Example ± C code: f = (g + h) - (i + j); ± Compiled MIPS code: add t0, g, h # temp t0 = g + h add t1, i, j # temp t1 = i + j sub f, t0, t1 # f = t0 - t1
Background image of page 6
Chapter 2 — Instructions: Language of the Computer — 7 Register Operands ± Arithmetic instructions use register operands ± MIPS has a 32 × 32-bit register file ± Used for frequently accessed data ± Numbered 0 to 31 ± 32-bit data called a “word” ± Assembler names ± $t0, $t1, …, $t9 for temporary values ± $s0, $s1, …, $s7 for saved variables ± Or $0-$31, accepted by certain assemblers ± Design Principle 2: Smaller is faster
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Chapter 2 — Instructions: Language of the Computer — 8 Register Operands ± $zero: constant 0 (reg 0) ± $at: Assembler Temporary (reg 1) ± $v0, $v1: result values (reg’s 2 and 3)
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/14/2011 for the course EE 270/370 taught by Professor Gangzheng during the Fall '11 term at Shanghai Jiao Tong University.

Page1 / 28

L2 Instructions_1_ - Topic 2 MIPS Instruction Set -...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online