MIPS Coding Question

ef1000
Program13.pdf

CDA 3103

Programming Assignment 1

Let m be a segment of data memory starting at location 5100 and ending at the first locations

(after 5100) that contains 0.

Write a MIPSzy program that computes:

• the sum of positive numbers in m (stored in data memory location 5084)

• the number of positive values in m (stored in data memory location 5088)

• the sum of negative numbers in m (stored in data memory location 5092); and

• the number of negative values in m (stored in data memory location 5096)

For example, if m contains:

5100 10

5104 12

5108 -5

5112 -6

5116 11

5120 1

5124 0

After execution of the program, data memory will contain:

5084 34

5088 4

5092 -11

5096 2

5100 10

5104 12

5108 -5

5112 -6

5116 11

5120 1

5124 0

Make sure that your program is clearly commented. There is no credit for programs that

are not commented.

Run your program using the simulator in Participation Activity 5.5.6 to make sure that

your program is correct.

Save your program with txt extension and submit the file online.