1
0
mirror of https://github.com/simh/simh.git synced 2026-02-27 09:09:46 +00:00

SCP: Fix output produced when EXAMINE an array register

This problem was a latent bug introduced when summarized array register
output was added back in 2013 or 2018.

This fixes the problem reported in https://github.com/open-simh/simh/issues/499
This commit is contained in:
Mark Pizzolato
2025-09-25 09:40:19 -10:00
parent 45fe20a34b
commit b838d94282

16
scp.c
View File

@@ -10536,18 +10536,10 @@ for (rptr = lowr; rptr <= highr; rptr++) {
if ((idx > lows) && (val == last_val))
continue;
if (idx > val_start+1) {
if (idx-1 == val_start+1) {
reason = ex_reg (ofile, val, flag, rptr, idx-1);
sim_switches = saved_switches;
if (reason != SCPE_OK)
return reason;
}
else {
if (val_start+1 != idx-1)
fprintf (ofile, "%s[%d]-%s[%d]: same as above\n", rptr->name, val_start+1, rptr->name, idx-1);
else
fprintf (ofile, "%s[%d]: same as above\n", rptr->name, val_start+1);
}
if (val_start+1 != idx-1)
fprintf (ofile, "%s[%d]-%s[%d]: same as above\n", rptr->name, val_start+1, rptr->name, idx-1);
else
fprintf (ofile, "%s[%d]: same as above\n", rptr->name, val_start+1);
}
last_val = val;
val_start = idx;