The integrated Code Simulator allows code definitions or fragments to be stepped through with the ability to place data on the stack and modify file memory locations. The simulator may be entered as if from a reset with SIMULATE or step through a definition with stack values by using SIM e.g.
| 1 2 SIM C+ (cr)
This is what you will see when the code is stepped through with the Space Bar. To exit the simulator press the Esc key. This is the code subroutine for C+ that would be compiled by REQUIRED or if an 8 bit plus was encountered with the SPEED flag off. Usually this code would be compiled in-line and optimised.
The simulator is a Host function and does not use the ICEPIC. The code simulated is taken from the Target image which may have been compiled in the Remote or Host modes. All register and file values are held in memory in the Host with stack values being automatically transferred to the file memory image when the simulator is entered.
SPACE - Steps through the Simulation one instruction at a time.
Esc - Escapes from a box and the Simulator.
B - Asks for a breakpoint address. Runs until found or Esc.
C - Asks for a Forth definition. If compiled, begins execution at the definition address.
D - Dumps 16 words from the Host Target image address entered.
F - Dumps the File memory space and allow modification. The dump is page sensitive.
G - Asks for an address and continues Simulation from there.
H - A box showing these commands.
I - Asks for an interrupt address. Stacks the current PC and begins Simulation at the address.
P - A box showing the current CPU flags that are ON.
R - Runs for a number of Simulation steps.
S - Places the given byte value in WREG and pushes it onto the Forth stack.
W - Loads the WREG with the given byte value.
0 - Forces a CPU reset and starts Simulation at $0000.
When using 'F' to show and modify the file memory, the registers may be referred to by name. e.g. PORTB. Also 'C' and 'G' may use named locations.