mirror of
https://github.com/simh/simh.git
synced 2026-04-18 00:48:13 +00:00
SDS: Clean up CPU modes and record CPU mode in instruction history record
The three CPU modes -- normal, monitor and user were represented by two binary flags (nml_mode and usr_mode). The code is simpler and easier to read if the three modes are represented by one three-valued variable, cpu_mode. In addition, record the CPU mode in the instruction history record, and add the mode to the history display. In addition, add an optional flag to the SET CPU HISTORY=n command to *not* record instructions executed in a particular CPU mode. Flags are -n, -m and -u for normal, monitor and user mode respectively. For example, SET -m CPU HISTORY=n will only record instructions executed in normal or user mode, and will not record instructions executed in monitor mode. This change aids user-mode program debugging by not filling the history with monitor-mode service functions and interrupt activity.
This commit is contained in:
@@ -81,7 +81,7 @@ extern uint32 int_req; /* int req */
|
||||
extern uint32 xfr_req; /* xfer req */
|
||||
extern uint32 alert; /* pin/pot alert */
|
||||
extern uint32 X, EM2, EM3, OV, ion, bpt;
|
||||
extern uint32 nml_mode, usr_mode;
|
||||
extern uint32 cpu_mode;
|
||||
extern int32 rtc_pie;
|
||||
extern int32 stop_invins, stop_invdev, stop_inviop;
|
||||
extern uint32 mon_usr_trap;
|
||||
@@ -431,7 +431,7 @@ switch (mod) {
|
||||
else if (inst & 01000) /* alert RL2 */
|
||||
alert = POT_RL2;
|
||||
if (inst & 02000) { /* nml to mon */
|
||||
nml_mode = usr_mode = 0;
|
||||
cpu_mode = MON_MODE;
|
||||
if (inst & 00400)
|
||||
mon_usr_trap = 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user