From af2b015383bbfea45e17f66b6a44cafb1c60b450 Mon Sep 17 00:00:00 2001 From: Dennis Boone Date: Sun, 21 Feb 2021 00:06:38 -0500 Subject: [PATCH] Fix for problem where PASCAL install test crashes. It appears that the emulator needs to check for faulted pointers after indirection in APs used in e.g. EAFA. PASCAL triggers this issue by using EAFA on an indirect pointer to a DYNT. A two cycle fault check is done other places, and the approach is repeated here. --- em.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/em.c b/em.c index ba615bb..e7bfe72 100644 --- a/em.c +++ b/em.c @@ -2352,7 +2352,7 @@ special: static ea_t apea(unsigned short *bitarg) { unsigned short ibr, ea_s, ea_w, bit, br, a; unsigned int utempl; - ea_t ea, ip; + ea_t ea, ip, iwea; eap = &gv.brp[RPBR]; utempl = get32(RP); @@ -2378,8 +2378,11 @@ static ea_t apea(unsigned short *bitarg) { bit = get16(INCVA(ea,2)) >> 12; else bit = 0; + iwea = ea; ea = ip; TRACE(T_EAAP, " After indirect, AP ea = %o/%o, bit=%d %s\n", ea>>16, ea & 0xFFFF, bit, searchloadmap(ea,' ')); + if (ea & 0x80000000) + fault(POINTERFAULT, ea>>16, iwea); /* XXX: faddr=0? */ } if (bitarg != NULL) *bitarg = bit;