Using the 1802 State Panel
The 1802 State panel lets you peek under the hood and see what's going on inside the simulated 1802 microprocessor, and to single-step through a program to watch the effect of instructions executing one by one.
To bring up the 1802 State panel, select the 1802 State command on TinyELF's Debug menu.
|
As you can see in the image above, the 1802 has quite a few internal registers, inputs, and outputs. The panel is broken up into four basic areas:
- Inputs
Inputs to the 1802 are arranged along the left side of the panel. These include 7 general purpose input ports (In 1 - In 7), 4 external flag inputs (EF1 - EF4), the interrupt line (INT), the DMA input request line (DMA-IN), and the DMA output request line (DMA-OUT). Chapter 3 of A Short Course in Programming covers the input ports and external flags, while information on DMA and interrupts can be found in Chapter 7.
- Outputs
Outputs appear in the upper right portion of the panel, and consist of 7 general purpose output ports (Out 1 - Out 7) and the Q output bit. Chapter 3 of A Short Course in Programming covers all of these.
- Internal Registers
The center area of the panel shows the many internal flags and registers of the 1802. Besides the 16 general purpose registers (R0 - RF), there is the data accumulator register (D), the carry bit or data flag (DF), the I and N registers that store the opcode being executed, the program counter selection register (P), the index selection register (X), the temporary register (T) used during interrupt service, and the interrupt enable bit (IE). Good descriptions of these registers can be found in Chapter 2 of A Short Course in Programming.
- Control
The remaining lower right section of the panel lets you set the mode of TinyELF, and is equivalent to using the Run and Load switches on the keypad. The Step button is used in Single Step mode to execute one instruction at a time. Chapter 2 of A Short Course in Programming discusses the modes of the 1802. Note, however, that TinyELF has a Single Step mode in place of the Wait mode of the original ELF II.
Click the Step button to execute a program one instruction at a time. Click Run in the 1802 State panel to continue running the program at normal speed.
|