

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Professor: Skavantzos; Class: COMPUTER ORGANIZATIO; Subject: Electrical Engineering; University: Louisiana State University; Term: Fall 2005;
Typology: Assignments
1 / 2
This page cannot be seen from the preview
Don't miss anything!


You should know how to use “xspim” Use “ main” at the beginning instead of “_start ” and assume no delayed branch when you are using xspim. Problem 1: Hard copy and leave your program on your account and name it mips2.asm. Write a MIPS program to show word statistics for a paragraph(textdata) Assume the longest word length is 25 output format: Occurrences of word contains : A .= 6 //{ A, DISTANT, GALAXY, CREATION, MYTHICAL, PLANET} so 6 B = ….. Z = ############################################################# .data textdata: .asciiz “IN A DISTANT GALAXY EONS BEFORE THE CREATION OF THE MYTHICAL PLANET KNOWN \n Table: .space 100 **#Hint) Words are separated by the space or spaces.
Problem 2: 2.1) Write MIPS programs for the following c programs , .. # REGISTER USAGE ..SUM , $s0, i, $t0, 1)...for(i = 1; i<5 ;++1) { sum = sum + i; } 2.1.1.1) assume Delayed branch without delay slot 2.1.1.2) assume Delayed branch with delay slot 2 )...for(i = 1; i<5;i = i+2) { sum = sum + i; sum = sum + i + 1; } 2.1.2.1) assume Delayed branch without delay slot 2.1.2.2) assume Delayed branch with delay slot 2-2)Count the total numbers of instructions(running instruction count) to compute sum for the 4 programs (2.1.1.1, 2.1.1.2, 2.1.2.1 and 2.1.2.2).
###################### Template for program 1 ######################
.data string: .asciiz "IN A DISTANT GALAXY EONS BEFORE THE CREATION OF THE MYTHICAL PLANET KNOWN" return: .asciiz "\n" newline: .asciiz "\n" .align 4 TABLE: .space 100 .text .globl main main: