MIPS slideshow - LanguageProgram Template for a MIPS...

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

View Full Document Right Arrow Icon
Skeleton of MIPS Assemble  Language Program  Template for a MIPS assembly language program: # Comment giving name of program and description of function # Template.s # Bare-bones outline of MIPS assembly language program .data # variable declarations follow this line # . .. .text # instructions follow this line main: # indicates start of code (first instruction to execute) # . .. # End of program, leave a blank line afterwards to make SPIM happy
Background image of page 1

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

View Full DocumentRight Arrow Icon
Data Declaration Format of Declaration: name: storage_type value(s) Create storage of variable of specified type wit given name and specified value Value(s) usually gives the initial values; for stoage, gives number of spaces be allocated.
Background image of page 2
Example – Declaration of  variables #create storage for single integer variable with # initial value 3 var1: .word 3 #create a 2 element character array with # elements initialized to ‘a’ and ‘b’ array1: .byte ‘a’ , ’b’
Background image of page 3

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

View Full DocumentRight Arrow Icon
Arithmetic Instructions most use 3 operands all operands are registers; no RAM or indirect addressing operand size is word (4 bytes)
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/09/2010 for the course CS 216 taught by Professor Ziang during the Spring '10 term at American College of Computer & Information Sciences.

Page1 / 12

MIPS slideshow - LanguageProgram Template for a MIPS...

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

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