MIPS - ABC 1 MIPS Assembly Language 2 So Far…. We have...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ABC 1 MIPS Assembly Language 2 So Far…. We have learnt about how numbers are represented in computers We have learnt Integer Representation both positive and negative IEEE 754 Floating Point Representation 3 What next? We would like to know what fundamental operations or instructions can a computer execute on these numbers 4 Instruction Set Different CPUs implement different sets of instructions. The set of instructions a particular CPU implements is called Instruction Set . Goals of Instruction Set: Must be able to compute anything in a reasonable number of steps Must be implementable 5 Instruction Set Architectures Early trend was to add more and more instructions to new CPUs to do elaborate operations RISC (Reduced Instruction Set Computing) philosophy (Cocke IBM, Patterson, Hennessy, 1980s) Keep the instruction set small and simple, makes it easier to build fast hardware. Let software do complicated operations by composing simpler ones. 6 MIPS Architecture MIPS – semiconductor company that built one of the first commercial RISC architectures Used in Sony Playstation, Cisco routers, HP Laser Printers, PDAs, Nintendo, … We will study the MIPS architecture in some detail in this class Why MIPS instead of Intel 80x86? MIPS is simple, elegant. Don’t want to get bogged down in gritty details. 7 Below the Program High-level language program (in C) swap (int v, int k) (int temp; temp = v[k]; v[k] = v[k+1]; v[k+1] = temp;) Assembly language program (for MIPS) swap: sll $2, $5, 2 add $2, $4,$2 lw $15, 0($2) lw $16, 4($2) sw $16, 0($2) sw $15, 4($2) jr $31 Machine (object) code (for MIPS) 000000 00000 00101 0001000010000000 000000 00100 00010 0001000000100000 . . . C compiler assembler 8 Assembly Variables: Registers Unlike HLL like C or Java, assembly language cannot use variables Why not? Keep Hardware Simple Assembly Operands are registers limited number of special locations built directly into the hardware operations can only be performed on these! Benefit: Since registers are directly in hardware, they are very fast 9 Assembly Variables: Registers Drawback: Since registers are in hardware, there are a predetermined number of them Solution: MIPS code must be very carefully put together to efficiently use registers 32 registers in MIPS Why just 32? Smaller is faster Can be addressed using smaller number of bits Each MIPS register is 32 bits wide Groups of 32 bits called a word in MIPS 10 Assembly Variables: Registers Registers are numbered from 0 to 31 Each register can be referred to by number or name Number references: $0, $1, $2, … $30, $31 11 Assembly Variables: Registers By convention, each register also has a name to make it easier to code For now: $16 - $23 $s0 - $s7 (correspond to C variables) $8 - $15 $t0 - $t7 (correspond to temporary variables)...
View Full Document

This note was uploaded on 12/02/2009 for the course CDA 3101 taught by Professor Small during the Spring '08 term at University of Florida.

Page1 / 61

MIPS - ABC 1 MIPS Assembly Language 2 So Far…. We have...

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

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