Prog1 - CSc 252 Program 1 Version 1.0 Program 1 Array...

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

View Full Document Right Arrow Icon
CSc 252 Program 1 Version 1.0 1 of 4 Program 1: Array Practice Program due: Thursday, September 29th, 11:59 p.m. Write a MIPS program named prog1.s .Your program will use an array labeled values . The number of words in the array will be stored in a word labeled numValues . There will be one additional integer provided, named printPositive . Your program will print the integers in the array, one to a line. Then, test the value of printPositive . If printPositive is a 1 , then print the positive integers in the array, one to a line. Examples: Here are two examples. In the first example, the value of printPositive is 0 : .data numValues: .word 12 values: .word 17 .word -50 .word 3 .word -23 .word -60 .word 97 .word 20 .word -82 .word 53 .word 30 .word -17 .word 142 printPositive: .word 0 # Your code goes below this line The result of executing prog1.s with this test case should be: The numbers in the array are: 17 -50 3 -23 -60 97 20 -82 53 30 -17 142 In the second example, the value of printPositive is 1 : .data numValues:
Background image of page 1

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

View Full DocumentRight Arrow Icon
CSc 252 Program 1 Version 1.0 2 of 4 .word 12 values: .word 17 .word -50 .word 3 .word -23 .word -60 .word 97 .word 20 .word -82 .word 53 .word 30 .word -17 .word 142 printPositive: .word 1 # Your code goes below this line The result of The result of executing prog1.s with this test case should be: The numbers in the array are: 17 -50 3 -23 -60 97 20 -82 53 30 -17 142 The positive numbers are: 17 3 97 20 53 30 142 Input: We will provide the first part of your program. This allows us to use different values to test your program. The .data section shown in each of the three examples represent what we
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/28/2012 for the course CSC 252 taught by Professor Moon during the Fall '11 term at Arizona.

Page1 / 4

Prog1 - CSc 252 Program 1 Version 1.0 Program 1 Array...

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

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