Fall 2016 CSCI 255 Homework 9

This assignment is due at 11:11 PM on 18 November.

The Problem

Start with the following C prototype.
    int printableCount(char S[], int n) ;
where S is an array of characters and n is the size of S. The function printableCount returns the number of ”printable“ characters if S. A character is considered printable if its value is between 32 and 126 inclusively. If you prefer ASCII, you can think of printable characters as being in the range of ' ' to '~'.

The task

Implement printableCount in MIPS32 assembly along with a testing main routine in C. The MIPS32 program should be stored in the file printableCount.s and the C program in printableTest.c .

Use MPLAB-X and the Microchip compilers in solving this problem.

Differences with lab solution

On the MIPS32, the char datatype is held in a single byte. This means that you should not need to use the sll instruction to multiply the index variable by 4. Also, you need to use lb, rather than lw, to load the byte from the array.


Compress, in either ZIP or tar.gz format, your MPLAB-X project and upload it to Moodle at the HW 9 dropoff by 11:11 PM on 11 November.

Absolutely every character used in your solution must be pressed by your own fingers.

Also, a log of all discussions regarding this assignments must be submitted with your submission.