diff --git a/PDP11/pdp11_hk.c b/PDP11/pdp11_hk.c index 0c6c6db0..e4c4b671 100644 --- a/PDP11/pdp11_hk.c +++ b/PDP11/pdp11_hk.c @@ -1178,7 +1178,7 @@ switch (fnc) { /* case on function */ else if (uptr->FNC == FNC_READ) { /* read? */ err = sim_disk_rdsect (uptr, da/HK_NUMWD, (uint8 *)hkxb, §sread, ((wc + (HK_NUMWD - 1)) & ~(HK_NUMWD - 1))/HK_NUMWD); if ((err == SCPE_OK) && - (sectsread != ((wc + (HK_NUMWD - 1)) & ~(HK_NUMWD - 1)/HK_NUMWD))) + (sectsread != (((wc + (HK_NUMWD - 1)) & ~(HK_NUMWD - 1))/HK_NUMWD))) err = -1; sim_disk_data_trace (uptr, (uint8 *)hkxb, da/HK_NUMWD, sectsread*HK_NUMWD*sizeof(*hkxb), "sim_disk_rdsect", HKDEB_DAT & dptr->dctrl, HKDEB_OPS); if (hkcs2 & CS2_UAI) { /* no addr inc? */ @@ -1197,6 +1197,9 @@ switch (fnc) { /* case on function */ } /* end if read */ else { /* wchk */ err = sim_disk_rdsect (uptr, da/HK_NUMWD, (uint8 *)hkxb, §sread, ((wc + (HK_NUMWD - 1)) & ~(HK_NUMWD - 1))/HK_NUMWD); + if ((err == SCPE_OK) && + (sectsread != (((wc + (HK_NUMWD - 1)) & ~(HK_NUMWD - 1))/HK_NUMWD))) + err = -1; sim_disk_data_trace (uptr, (uint8 *)hkxb, da/HK_NUMWD, sectsread*HK_NUMWD*sizeof(*hkxb), "sim_disk_rdsect", HKDEB_DAT & dptr->dctrl, HKDEB_OPS); awc = wc; for (wc = 0; wc < awc; wc++) { /* loop thru buf */