CIS 351

Assembly Loops

Fall 2018

For this homework, you are going to write and test some assembly code using loops. As with previous assignments, in order for your solution to work with my testing software, you must follow these rules:

Problems

1. int indexOf(int value, int[] array)
Return the index of the first element of array that is equal to value, or return -1 if value doesn't appear in array. For this problem, a negative value will mark the end of array.
2. int max(int[] array, int length)
Return the largest value in array.
3. sum13(int[] array, int size) from CodingBat.
4. sum67(int[] array, int size) from CodingBat.
5. void reverse(char[] string)
Reverse string in place. string will be null-terminated. Hint: Set up two pointers, one to the first character, one to the last. Then "walk" the pointers toward the middle swapping as you go.
6. void evenOdd(int[] array, int size)
Re-arrange array in place such that all the even numbers come before all the odd numbers. The numbers may be in any order, so long as the evens come before the odds. This problem is based on the evenOdd CodingBat problem; however, unlike the CodingBat problem, you are not allowed to write data outside of the array.

You may use this class as a starting point for your MUnit tests.

Submission and grading

When your code passes all tests, submit the .asm and test files using Blackboard's Assignment Manager. Your grade is based on when your code passes all tests. If your code passes all tests by the due date, you get 100%. Otherwise, you lose 5% for each day it takes you after the due date to submit correct code. In addition, you lose 5% for each incorrect submission. For example, if your first submission is two days late, but completely correct, your score will be 90%. If you submit incorrect solutions on the due date, and then submit the correct solutions two days later, your score will be 85%.


Updated Saturday, 20 October 2018, 7:20 PM

W3c Validation