TC1 postscript mark II
If one postscript is good, two are even better. We’ve added this second variation on a theme to demonstrate some different ways of doing things. Much of the program’s structure is the same as before. The features are as follows:
- Direct execution (revisited)
- The ability to avoid different mnemonics (e.g.,
ADD
andADDL
) for the same basic operation
The principal enhancement is the way to handle instructions and decode them. In TC1, we use a 4-bit code to define the structure of each instruction in terms of its parameters. When a mnemonic is looked up in the dictionary, it returns a code giving the required parameters.
One feature (problem?) with TC1 is that we have different mnemonics for variations on an instruction, for example, ADD
and ADDL
. The suffix L
tells the assembler that a literal operand (rather than a register number) is required. In this example, we avoid different instruction formats and use a single mnemonic by...