L09 - CS 61C L09 MIPS Load/Store, Branch (1) Wawrzynek Fall...

Info iconThis preview shows pages 1–4. 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
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS 61C L09 MIPS Load/Store, Branch (1) Wawrzynek Fall 2007 © UCB 9/17/2007 John Wawrzynek (www.cs.berkeley.edu/~johnw) www-inst.eecs.berkeley.edu/~cs61c/ CS61C – Machine Structures Lecture 9 - MIPS Load/Store & Branch Instructions CS 61C L09 MIPS Load/Store, Branch (2) Wawrzynek Fall 2007 © UCB Review ° In MIPS Assembly Language: • Registers replace variables • One Instruction (simple operation) per line • Simpler is Better, Smaller is Faster ° Instructions introduced: add, addi, sub ° General Purpose Registers Introduced: C Variables: $s0- $s7 Temporary Variables: $t0- $t7 Zero: $zero CS 61C L09 MIPS Load/Store, Branch (3) Wawrzynek Fall 2007 © UCB Assembly Operands: Memory ° C variables map onto registers; what about large data structures like arrays? ° 1 of 5 components of a computer: memory contains such data structures ° But MIPS arithmetic instructions only operate on registers, never directly on memory. ° Data transfer instructions transfer data between registers and memory: • Memory to register • Register to memory CS 61C L09 MIPS Load/Store, Branch (4) Wawrzynek Fall 2007 © UCB Anatomy: 5 components of any Computer Personal Computer Processor Computer Control (“brain”) Datapath Registers Memory Devices Input Output Load (from) Load (from) Store (to) Store (to) These are “data transfer” instructions… Registers are in the datapath of the processor; if operands are in memory, we must transfer them to the processor to operate on them, and then transfer back to memory when done. CS 61C L09 MIPS Load/Store, Branch (5) Wawrzynek Fall 2007 © UCB Data Transfer: Memory to Reg (1/4) ° To transfer a word of data, we need to specify two things: • Register : specify this by # ($0 - $31) or symbolic name ($s0,…, $t0, …) • Memory address : more dif¡cult- Think of memory as a single one- dimensional array, so we can address it simply by supplying a pointer to a memory address.- Other times, we want to be able to offset from this pointer. ° Remember: “ Load FROM memory ” CS 61C L09 MIPS Load/Store, Branch (6) Wawrzynek Fall 2007 © UCB Data Transfer: Memory to Reg (2/4) ° To specify a memory address to copy from, specify two things: • A register containing a pointer to memory • A numerical offset ( in bytes ) ° The desired memory address is the sum of these two values....
View Full Document

This note was uploaded on 04/09/2008 for the course CS 61A taught by Professor Harvey during the Spring '08 term at Berkeley.

Page1 / 12

L09 - CS 61C L09 MIPS Load/Store, Branch (1) Wawrzynek Fall...

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

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