Architecture
Introduction
To get the PDP-10 to solve sudokus and learn how to code in PDP-10 assembly, we
should first consider, what functions we need, and how to structure the code, so
we can build small, fast and reusable functions. Since organising code in
assembly is a lot harder than in high-level programming languages such as LISP
and C, we should first plan how the program should look like, before we start
writing the actual code. This way, we can encapsulate the code and make it
reusable. The program will follow a simple flow:
The program can be split into multiple parts. The above diagram showing the
general flow, but putting the solve puzzle part into a black box. This
subroutine contains the actual algorithm, and will be analysed later. The other
functions a more trivial, but nonetheless necessary. We need:
- A routine that prints text on the terminal
- We need a routine, that can grab the parameters a user passed to the command
line, and read the command line parameters. since ITS does not have a built-in
mechanism for this, we need to write our own.
- We need to be able to open the file, that was passed to us, and open it, as
well as reading the data from it.
- We need a data structure to store the playing field in.
- We need a routine, that clears the screen and shows the current state of the
playing grid on the screen.