UPF - Computer Organization Seminario 3 - MIPS Arrays

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

UPF - Computer Organization

Seminario 3 - MIPS arrays

1.

(A) Given the following excerpt of code where you declare three different types of vectors :

Describe how the memory will allocate space for the data

(B) See the following code where the statement of data changes

In this case, what the memory will looks like? We must make some changes to the defined
data to be able to use them? Suggest the change and indicate how the report would in this
case.

(C) The statement of the data changes again and is now as follows

How the memory will be?

2. Now you want to access data defined in exercise 1 (a) and load the register for
operations. Write code to load array_byte, and array_half array_word to the registers.
3. Once assembled without errors, imagine you run the following code

resulting in the following execution error

Error in (...) at runtime exception (...): store address not aligned on word boundary (...).

What are the possible causes of the error? What would you do to fix it?

4. Complete the following code so that the vector decimal pi is correct. Also the screen will
display the last decimal vector.

5. Complete the following code to the end of the execution. So that the vector will contains
the initial values in its absolute value.
6. Write a program that displays on screen the greatest values of a vector as belows.

7. Given a sentence, count the number of uppercase and lowercase letters and also other
characters it contains.
8. Complete the gaps in the codes below (This exercise is to be delivered).

You might also like