Skip to content

Commit 6e9324e

Browse files
shatteredpkoning2
authored andcommitted
PDP11: Changes for Terak 8510/a simulator:
Accept devices mapped at IOPAGEBASE -- text buffer/character generator memory on video board starts at 160000. Clear invalid PSW bits in trap handler -- system acceptance test writes PSW 113705 to vector 34 (TRAP instruction).
1 parent 042b635 commit 6e9324e

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

PDP11/pdp11_cpu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,7 @@ while (reason == 0) {
923923
}
924924
src = ReadCW (trapea | calc_ds (MD_KER)); /* new PC */
925925
src2 = ReadCW ((trapea + 2) | calc_ds (MD_KER)); /* new PSW */
926+
src2 = src2 & cpu_tab[cpu_model].psw; /* mask off invalid bits */
926927
t = (src2 >> PSW_V_CM) & 03; /* new cm */
927928
trapea = ~t; /* flag pushes */
928929
WriteCW (PSW, ((STACKFILE[t] - 2) & 0177777) | calc_ds (t));

PDP11/pdp11_io_lib.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ if (dibp == NULL)
117117
newba = (uint32) get_uint (cptr, DEV_RDX, IOPAGEBASE+IOPAGEMASK, &r); /* get new */
118118
if (r != SCPE_OK)
119119
return r;
120-
if ((newba <= IOPAGEBASE) || /* > IO page base? */
120+
if ((newba < IOPAGEBASE) || /* > IO page base? */
121121
(newba % ((uint32) val))) /* check modulus */
122122
return SCPE_ARG;
123123
dibp->ba = newba; /* store */
@@ -139,7 +139,7 @@ dptr = find_dev_from_unit (uptr);
139139
if (dptr == NULL)
140140
return SCPE_IERR;
141141
dibp = (DIB *) dptr->ctxt;
142-
if ((dibp == NULL) || (dibp->ba <= IOPAGEBASE))
142+
if ((dibp == NULL) || (dibp->ba < IOPAGEBASE))
143143
return SCPE_IERR;
144144
if ((sim_switches & SWMASK('H')) || (sim_switch_number == 16))
145145
radix = 16;

0 commit comments

Comments
 (0)