ASM Debugging Window
The ASM Debugging Window can be
opened and closed by using the Debug4x Main Window's DebugView Menu or by the
shortcut keys ctrl+A (think of ASM).
There are many components in this complex window:
- CPU Registers
- RSTK
- V1 and V2 ROM Views (HP48: Enable Slot 2,
and Bank Number)
- Er Stk Flag
- Db. It (Debug Interrupt Option)
- HST Flags
- Bin, Carry and
Int Flags
- ST Flags
- CPU Ticks, Last Cycle and CRC
Counts
- Last Instruction Stack
- Memory Contents
- Buttons
CPU Registers
These are the main CPU registers: A, B, C, D, R0,
R1, R2, R3, R4, R5, PC, D0 and D1. Whenever
a register is modified (when the emulation is stepped or run/stopped) the register is
displayed in RED, helping you to see what the
instruction just did. Registers may be edited with the mouse and keyboard.
Changes are tracked immediately.
Clicking on any part of a register will update the memory display
to match the address area of that register.
RSTK
Here are the 8 RSTK values.
V1 and V2 ROM Views
These are the controls for the bank switching registers for the HP49.
During HP48 emulation, V1 is replaced by the Enable Card Slot 2 flag and
V2 becomes the Card Slot 2 Bank Number.
Er Stk Flag
When checked, an alarm will be raised if Debug4x sees more than 6 RSTK
levels in use. The SATURN
is limited to 6 levels of RSTK if the interrupt system is enabled, 7 if the
interrupt system is disabled and the flag 15 is clear.
8 levels are allowed in the interrupt system.
Db. It
When checked, interrupt debugging will be allowed and the window will
step through the interrupt code. It is usually better to leave this box
unchecked.
Hardware Status
Flags
(HST)
The HST flags can be set or cleared. Hover the mouse
over each checkbox to see which status flag is affected by changes.
Bin Flag
The binary mode flag. If this checkbox is
checked, the calculator is in decimal mode.
Carry Flag
The carry
flag.
Int Flag
Interrupt status flag.
This
flag is checked when the calculator is in the interrupt system. Normally
the SASM debugger will skip the interrupt code. Selecting the
Db. It checkbox will allow debugging of interrupt code.
ST Flags
These are the 16 status flags. Hover the mouse button over each to
get its number.
CPU Ticks Counter
The value of the CPU Ticks counter is the huge number under
HST.
Under the CPU Ticks Counter is the number of cycles since the last display. This is useful to get an idea of the time used by an instruction or a sub function call. This number may not always be accurate.
CRC
The value of the CRC calculation.
Last Instruction Stack
The upper right corner
contains the last 256 ASM instructions. The first
instruction is the next instruction to be executed. The instructions below are the instruction that
have been executed.
Memory Contents
The bottom, left part of the window contains the memory editor. Clicking on a register changes the starting address of
the memory editor (click on D1 for
example). The memory editor provides a display and
modification method for the calculator'smemory (use the 0-9,A-F keys to write
data in hex or any key when editing in the ASCII
area). The memory will be instantaneously modified as keys are pressed.
Flash memory cannot be changed by this window.
Various areas of the memory display can be affected by the settings and changes to the V1 and V2 registers.
Step In
Single step the emulation. If a subroutine is called, follow the
thread down into the subroutine.
Step Over
Single step the emulation. If a subroutine is called, execute the
subroutine at full speed then resume single stepping after thecall.
Stp by Stp (Step by Step)
Put the emulation into step by step mode. All display contents will
be updated.
Continue
Put the emulation into full speed mode. The display contents will
no longer be updated.
Update
Take a quick, dynamic snapshot of the CPU without stopping. This
can be sued to monitor progress of a long operation. In general, the
contents of the displays are not reliable after this operation because the
emulator has continued operations.
Snapshot and Compare Buttons
The
Snapshot button takes a 'snapshot' of the CPU state for comparison
with a future state. The Compare button compares the current state with
the last Snapshot and shows the differences. This tool can be very useful
in testing of a
subroutine. Take a snapshot at the beginning of
the function and compare it at the end to ensure the function is not using more registers that it should.