[Simh] pdp11/70: trap to 4 or 10

Walter F.J. Mueller W.F.J.Mueller at gsi.de
Tue Dec 12 15:03:36 EST 2006


Hi all,

when doing some systematic tests of the 11/70 emulation I found that a
JMP with register destination traps to 10. Based on the docs I assumed
a trap to 4 taken. Here the argument:

The 'Software Differences' Appendix of the 'J11 User Guide' states:

   JMP %R or JSR reg,%R trap to 4 on a 44,45,70 or J11
                         and to 10 on all others

PDP11/sim_defs.h states:

/* JREG4                JMP/JSR R traps to 4  */
#define HAS_JREG4       (CPUT_03|CPUT_04|CPUT_05|CPUT_20|CPUT_F| \
                         CPUT_34|CPUT_40|CPUT_60|CPUT_T)

The JMP and JSR code in PDP11/sim_cpu.c does

  if (dstreg) setTRAP (CPUT (HAS_JREG4)? TRAP_PRV: TRAP_ILL);

where

#define TRAP_V_PRV      5             /* priv inst      4 */
#define TRAP_V_ILL      6             /* illegal inst  10 */

So on a 11/70 HAS_JREG4 is not set, and a trap to 10 is indeed taken.

It seems, unless I mixup something, that the definition of
HAS_JREG4 is inverted, that it should actually read

#define HAS_JREG4       (CPUT_44|CPUT_45|CPUT_70|CPUT_J)


		With best regards,

			Walter Mueller

-- 
Dr. Walter F.J. Müller    Mail:  W.F.J.Mueller at gsi.de
GSI,  Abteilung KP3       Phone: +49-6159-71-2766
D-64291 Darmstadt         FAX:   +49-6159-71-3762
URL: http://www-linux.gsi.de/~mueller/



More information about the Simh mailing list