Objectives:

Learn how to write an assembly program that consists of functions, learn the MIPS calling conventions, and learn how to access a two-dimensional array in assembly language. This will also be an exercise in gaming and game strategy solutions.

The Classic Sudoku is a number placing puzzle based on a 9x9 grid with several given numbers. The object is to place the numbers 1 to 9 in the empty squares so that each row, each column and each 3x3 box contains the same number only once. The following is an example of a valid Sudoku puzzle.

2 7 1 9 5 4 6 8 3
5 9 3 6 2 8 1 4 7
4 6 8 1 3 7 2 5 9
7 3 6 4 1 5 8 9 2
1 5 9 8 6 2 3 7 4
8 4 2 3 7 9 5 6 1
9 8 5 2 4 1 7 3 6
6 1 7 5 9 3 4 2 8
3 2 4 7 8 6 9 1 5

Specifications:

1. There will be 2 test files:

a. puzzlel.dat # Valid Puzzle.
b. puzzle2.dat # Invalid Puzzle

2. Use the sample code provided to read in the file name, open the file, and read the file into a character array.

3. The file will consist of 81 consecutive integer numbers separated by one space.

a. The first set of 9 numbers will be row 1st, the second set of 9 numbers will be the 2nd row, the third set of 9 numbers will be the 3rd Row, etc.
b. You can assume that the file will be correct and have exactly 81 numbers with no invalid integers ( i.e. less than 0 or greater than 9).

4. Your Program must incorporate the following:

a. parameter passing and return values
b. preserving register values, as presented
c. In addition, you should not have any conditional branch instructions that cross function boundaries.
d. A comment beside each instruction is required in the assembly program (or at a minimum a comment for a small group of related instructions) to help make your code more understandable. You should also have comments at the top of the file indicating your name, this course, and the assignment.

5. Your program must indicate whether the file that was submitted represents a valid solution, or whether there is an error in the row, column, and/or 3x3 quadrant.

Sample Output:

puzzlel.dat file

|1|2|3|4|5|6|7|8|9|
|-|-|-|-|-|-|-|-|-|
|4|5|6|7|8|9|1|2|3|
|-|-|-|-|-|-|-|-|-|
|7|8|9|1|2|3|4|5|6|
|-|-|-|-|-|-|-|-|-|
|2|3|1|5|6|4|9|7|8|
|-|-|-|-|-|-|-|-|-|
|5|6|4|8|9|7|3|1|2|
|-|-|-|-|-|-|-|-|-|
|8|9|7|2|3|1|6|4|5|
|-|-|-|-|-|-|-|-|-|
|3|1|2|6|4|5|8|9|7|
|-|-|-|-|-|-|-|-|-|
|6|4|5|9|7|8|2|3|1|
|-|-|-|-|-|-|-|-|-|
|9|7|8|3|1|2|5|6|4|

Valid Sudoku Puzzle
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.