SCP: Added REG_V_UF and REG_UFMASK to support user-defined register flags. From Dave Bryan
Altered the calling sequences to fprint_sym and parse_sym in ex_reg and dep_reg to merge user-defined register flags with the radix in the addr parameter. This allows the print and parse routines to identify the register or determine how it is to be handled. These are called in lieu of the standard print and parse routines if a register has REG_VMIO or at least one user-defined flag set.
This commit is contained in:
parent
13bb3356f5
commit
1ef6c3d6b9
3 changed files with 13 additions and 4 deletions
BIN
doc/simh.doc
BIN
doc/simh.doc
Binary file not shown.
11
scp.c
11
scp.c
|
@ -6504,8 +6504,9 @@ if (!(flag & EX_E))
|
|||
GET_RADIX (rdx, rptr->radix);
|
||||
if ((rptr->flags & REG_VMAD) && sim_vm_fprint_addr)
|
||||
sim_vm_fprint_addr (ofile, sim_dflt_dev, (t_addr) val);
|
||||
else if (!(rptr->flags & REG_VMIO) ||
|
||||
(fprint_sym (ofile, rdx, &val, NULL, sim_switches | SIM_SW_REG) > 0)) {
|
||||
else if (!(rptr->flags & REG_VMFLAGS) ||
|
||||
(fprint_sym (ofile, (rptr->flags & REG_UFMASK) | rdx, &val,
|
||||
NULL, sim_switches | SIM_SW_REG) > 0)) {
|
||||
fprint_val (ofile, val, rdx, rptr->width, rptr->flags & REG_FMT);
|
||||
if (rptr->fields) {
|
||||
Fprintf (ofile, "\t");
|
||||
|
@ -6603,8 +6604,10 @@ if ((rptr->flags & REG_VMAD) && sim_vm_parse_addr) { /* address form? */
|
|||
if ((tptr == cptr) || (*tptr != 0) || (val > mask))
|
||||
return SCPE_ARG;
|
||||
}
|
||||
else if (!(rptr->flags & REG_VMIO) || /* dont use sym? */
|
||||
(parse_sym (cptr, rdx, NULL, &val, sim_switches | SIM_SW_REG) > SCPE_OK)) {
|
||||
else
|
||||
if (!(rptr->flags & REG_VMFLAGS) || /* dont use sym? */
|
||||
(parse_sym (cptr, (rptr->flags & REG_UFMASK) | rdx, NULL,
|
||||
&val, sim_switches | SIM_SW_REG) > SCPE_OK)) {
|
||||
val = get_uint (cptr, rdx, mask, &r);
|
||||
if (r != SCPE_OK)
|
||||
return SCPE_ARG;
|
||||
|
|
|
@ -565,6 +565,8 @@ struct sim_reg {
|
|||
uint32 qptr; /* circ q ptr */
|
||||
};
|
||||
|
||||
/* Register flags */
|
||||
|
||||
#define REG_FMT 00003 /* see PV_x */
|
||||
#define REG_RO 00004 /* read only */
|
||||
#define REG_HIDDEN 00010 /* hidden */
|
||||
|
@ -576,6 +578,10 @@ struct sim_reg {
|
|||
#define REG_FIT 01000 /* fit access to size */
|
||||
#define REG_HRO (REG_RO | REG_HIDDEN) /* hidden, read only */
|
||||
|
||||
#define REG_V_UF 16 /* device specific */
|
||||
#define REG_UFMASK (~((1u << REG_V_UF) - 1)) /* user flags mask */
|
||||
#define REG_VMFLAGS (REG_VMIO | REG_UFMASK) /* call VM routine if any of these are set */
|
||||
|
||||
/* Command tables, base and alternate formats */
|
||||
|
||||
struct sim_ctab {
|
||||
|
|
Loading…
Add table
Reference in a new issue