TC1 postscript
The version of TC1 presented here grew during the development of this book. The current version has more features than the prototype; for example, initially, it didn’t include symbolic branch addresses and required users to enter actual line numbers.
Here, we’re presenting a cut-down version of TC1, called TC1mini, where we do some things differently; for example, by not allowing a free format (mnemonics must be uppercase and registers lowercase, and you can’t use spaces and commas as interchangeable delimiters). In this version, a simple function checks that the mnemonic is valid and terminates the program if it isn’t. Similarly, we’ve added a feature that checks whether an address generated by a pointer lies within the bounds of your memory space. The following section provides some comments on this version.
The classDecode function
TC1 associates a 4-bit binary value with each instruction to indicate that parameters are...