— There seem to be two main types of people in the world, crosswords and sudokus.— 

  Year: 2014

  Craft(s): Easy68k, Coldfire, MC68000

,  ]

And I’m neither of them. I usually get soon bored by games, but coding them is actually one of the most entertaining ways of learning new programming languages.

I was learning ASM with the Easy68k simulator by creating this very simple Sudoku game and found very few examples on the Internet from which to get inspired, so here’s my very humble attempt for anyone to use.

You can download the .x86 file from here:

For an installation guide of the simulation software, please visit this blog post at Obsessive Coffee Disorder:
Easy68k Tricks & Tips – at OCD

The Game

The flow of the main program will let the user choose between a 4×4 game or the classical 9×9 game. It is obviously far easier to start off and debug a 4×4 game and then extrapolate to a bigger one, than starting right away with a 9×9 board.

Screen Shot 2014-06-11 at 13.54.33

Once inside the game the flow goes something like this on the right, plus the possibility of three different levels for the 4×4 board.

Screen Shot 2014-06-11 at 13.58.34

The output is shown in the Easy68k Simulator window as shown below. Inputs are received as 3 character strings in the format [row][column][number]. Therefore, a number such as «342» would place a 2 on row 3 – column 4. On each iteration the program will check wether the board is completed or not and, if it is, wether it is correctly done or not. You can always type [m] at any time to bring back the main menu, where a [q] will shut down the program by jumping to SIMHALT (same to old task #9 for TRAP #15).


The memory

The program starts on address $1000 and spans up to $1C71. All strings come in from about $17FC until the end.

From address $1D00, memory is reserved for C_PRINT, which is the string that will print the board the user sees. It is formed with different ASCII symbols and the values from C_USUARIO.

C_USUARIO, on the other hand, only contains the string with the numbers and is stored at $2000 onwards. Here is where the input from the user is stored.

Address $1FF0 is reserved with the name MENUOPT to store any temporary menu option so that it is’s safe that it won’t be overriding any important information.

Screen Shot 2014-06-11 at 14.03.01

Leave a Reply

Your email address will not be published. Required fields are marked *