A. Emulator and Debugger Reference
Part of
the Hawk Manual
|
HAWK EMULATOR 01234567 /------------------CPU------------------\ /----MEMORY----\ PC: 00000000 R8: 00000000 -*000000: NOP PSW: 00000000 R1: 00000000 R9: 00000000 000002: NOP NZVC: 0 0 0 0 R2: 00000000 RA: 00000000 000004: NOP R3: 00000000 RB: 00000000 000006: NOP R4: 00000000 RC: 00000000 000008: NOP R5: 00000000 RD: 00000000 00000A: NOP R6: 00000000 RE: 00000000 00000C: NOP R7: 00000000 RF: 00000000 00000E: NOP **HALTED** r(run) s(step) q(quit) ?(help)
Hawk emulators and low-level debuggers should offer a standard display of the CPU state. The entire display is shown above, with the parts of the display broken out below.
/------------------CPU------------------\ PC: 00000000 PSW: 00000000 NZVC: 0 0 0 0
The upper left corner of the display should show the values of the program counter (PC) (see Section 1.3.2) and the processor-status word (PSW) (see Section 1.3.4.1) these should be displayed in hexadecimal. In addition, the 4-bit condition code field of the PSW (NZVC) should be displayed in binary.
If any coprocessor is enabled, the coprocessor status word (COSTAT) (see Section 1.3.3). should be displayed in hexidecimal after a blank line below the condition codes. If the floating point unit is enabled and selected, the approximate values of the two floating point accumulators (A0 and A1) (see Section 15.1.3) should be displayed in decimal.
/------------------CPU------------------\ R8: 00000000 R1: 00000000 R9: 00000000 R2: 00000000 RA: 00000000 R3: 00000000 RB: 00000000 R4: 00000000 RC: 00000000 R5: 00000000 RD: 00000000 R6: 00000000 RE: 00000000 R7: 00000000 RF: 00000000
The general purpose registers (see Section 1.3.1) r[0] through r[15] should occupy the center of the CPU display, in two columns. The register values should be shown in hexadecimal. The register labels R1 through RF also use hexidecimal.
/----MEMORY----\ -*000000: NOP 000002: NOP 000004: NOP 000006: NOP 000008: NOP 00000A: NOP 00000C: NOP 00000E: NOP
The left column in the memory display shoul show the least significant 24 bits of the memory address, in hexidecimal. When the emultor is running, the memory window should always include the region of memory that includes the current instruction. The address containing the current instruction should be shown with either -> pointing to it or (as in the above example, -*. The asterisk *, if present, should mark a memory address that has been set as a breakpoint. The contents of memory may be displayed in two modes:
HAWK EMULATOR 01234567 /------------------CPU------------------\ /----MEMORY----\
When the the emulator or debugger is halted, hexadecimal input from the keyboard is accepted. If a nonzero value has been entered, this is displayed near the top center of the emulator display. This number is only used by emulator commands; when a command uses this number, it is set to zero.
**HALTED** r(run) s(step) q(quit) ?(help)
Debugger and emulator displays should give the emulator or debugger mode at the bottom of the display, above any part of the window reserved for interacting with the emulated program. The two modes are RUNNING or **HALTED**, and a list of active commands should be shown after the mode.
In running mode, the only command is control-C; this should halt the emulator or debugger. All other input should be directed to the running Hawk program.
In halted mode, a short menu of active commands should be displayed after the mode indicator. If the set of active commands is too long to fit on one line, one of the commands in the list should be a help command that scrolls through other commands.
All emulator commands are one letter each, possibly taking the hexidecimal number previously entered from the keyboard as a parameter.
Hawk emulators and debuggers should support the following commands to control the memory display:
All commands that start the CPU running (n, r, p and i) should change the operating mode to running. The mode should change from running to halted when any of the following occurs: