Debug Station

The circuit block works like a debugging tool for microprocessors. It allows low level access to the machine. Its core function is to enter, test and modify machine code. To this end it needs to read and write both the parameter and code memory spaces. The only way to write to the code space is through this circuit. Access to the primary registers may be included. The functions provided by this station are:

* Read and write any location in main memory - both data and program spaces.
* Latch a value into the Instruction Register.
* Single step execute the current instruction with or without fetching the next instruction.
* Latch a value into the Instruction Pointer and
* Fetch the next instruction but do not execute it.
* Read and write any register, including the status bits.
* Insert HALT or BREAK commands in a specified location in program space.
* Start execution at a specified location (in program space).

# Circuitry

The Debug Station has enables on all its outputs so that it has no effect during normal operation (Remember all SC electrics have 'wire-OR' inputs). It outputs an address and can either output or input the data from that address location because it also controls the (tristate) Rd/Wr signal to the memory arrays. It is assumed that the main system is put into a HALTed state before using the Debug Station to modify memory.

If necessary, some circuits may be interrupted by a piston! So they can be disabled without incurring extra delay while running. The Program Counter may be interrupted in this way to provide the HALT operation

# User Operation

The hex numeric keypad and the cursor control keys are used to enter a number into the top display. If this is for an address or the parameter space memory then only the first 4 digits are important and the last 2 are ignored. To set this as the address you press the SET button and it is transferred to the address display on the right. To read from that address simply press [@] the FETCH symbol for me and the contents of that address will be fetched and latched into the bottom display. Or enter another number to be used as data in the top display and press [!] the STORE symbol for me to write that data at the specified address location. OR (if implemented) press [X] to read the data at that address and then write to it.

(The register access section isn't done yet...)
BUT
The registers TOS NOS (SP?) TOR (RP?) MEM PC CC are all brought together for display and each one may be overwritten by pressing the [!] button next to the display. This writes the value displayed in the top display into that particular register. There is no provision to "read" the registers since they are always displayed.

# Software Support

The machine code includes an instruction HALT, which stops the advancement of the PC. The user then can use the debug station without interferrence. The station can also insert a JMP-immediate opcode, which can jump to a debug routine. (?)

# Options

The debug station includes a small set of machine code routines put into main code memory, to help with its operation. These routines are position independent and may be loaded into program space at any specified location, so they won't interfere with the program being debugged. The base location must be known and entered into the station to use them.

One routine copies the instruction from a specified location and saves it in a register file then replaces it with the HALT instruction? -That is easily done using the station...-