pcspim - COMPUTERORGANIZATIONandDESIGN Start developing...

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

View Full Document Right Arrow Icon
COMPUTER ORGANIZATION and DESIGN PCSpim Your source code file (2) Program Definition (1) Data (3) Program Body Start developing your first assembly program using SPIM Prepare your source code Step #1 Three major components in your SPIM program
Background image of page 1

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

View Full DocumentRight Arrow Icon
COMPUTER ORGANIZATION and DESIGN
Background image of page 2
COMPUTER ORGANIZATION and DESIGN PCSpim The three components in your SPIM program 1. “Data” Section This is the place where you keep any constants in your program - Error messages - Prompt messages for user input - Any constants, such as “3.14” - Input/Output buffers (contents vary, but buffer size unchanged) The data section is declared with the “ .data ” assembler directive SPIM assumes the data section is at the beginning - Because the program code is supposed to be at the end
Background image of page 3

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

View Full DocumentRight Arrow Icon
COMPUTER ORGANIZATION and DESIGN PCSpim The three components in your SPIM program (continued) 2. “Program Definition” Section This is the place where you declare your assembly program The program definition section is declared with the “ .text ” assembler directive The beginning label of your assembly program declared with “ .globl name_of_your_beginning_label The program definition section should be the simplest (and shortest) We will see this in examples later
Background image of page 4
COMPUTER ORGANIZATION and DESIGN PCSpim The three components in your SPIM program (continued) 3. “Program Body” Section This is the place where you write your program (assembly instructions) Your program should end with a “jr $31” instruction
Background image of page 5

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

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

This note was uploaded on 05/25/2011 for the course ELECTRONIC 749 taught by Professor Aliziyaalkar during the Spring '11 term at Hacettepe Üniversitesi.

Page1 / 24

pcspim - COMPUTERORGANIZATIONandDESIGN Start developing...

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

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