


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
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. Estimated time to finish: Prob. 1 : 5 hours. Prob.2 :1 hours. Prob.3: 1 hours. Total : 7 hours. When you submit the Hw., Please write down how much time did you spend for the problems. How to submit: Hard copy during the class and program on your account and name it( mips1.asm) for problem 1. Just hard copy for problem 2 and problem 3.
and leave your program on your account and name it mips1.asm.
Assume the longest word length is 25 output format: Occurrences of word of length x: 1 character word .= 1 2 character word .= 6. 3 …. ….. 25.character word. = 0
.data textdata: .asciiz “In a distant galaxy eons before the creation of the mythical planet known as Earth, vast civilizations have evolved, and ruling the galaxy is an interstellar Empire created from the ruins of an Old Republic that held sway for generations\n
Table: .space 100 **_#Hint) Words are separated by the space or spaces.
null(\n)
.. # 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
sum for the 4 programs (2.1.1.1, 2.1.1.2, 2.1.2.1 and 2.1.2.2).
What_am_I_doing: move $t0,$a srl $t0,$t0, sll $t0,$t0,2 # sub $t2,$a0,$t0 # addi $t4, $zero, mul $t3,$t2,$t4 #