From a6689e145865e5f3e6d0348831db29852081a41a Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Sat, 19 Nov 2016 17:08:43 -0800 Subject: [PATCH] Added notes on the question of whether addressing mode 5 (auto-decrement deferred) can trigger a stack overflow on any PDP-11 model --- apps/pdp11/tapes/diags/README.md | 2 +- modules/pdp11/lib/cpustate.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/pdp11/tapes/diags/README.md b/apps/pdp11/tapes/diags/README.md index 62ba419bf..ef5905075 100644 --- a/apps/pdp11/tapes/diags/README.md +++ b/apps/pdp11/tapes/diags/README.md @@ -347,7 +347,7 @@ stack overflow; eg: SP=000376 PC=021734 PS=000340 IR=000000 SL=000377 T0 N0 Z0 V0 C0 021734: 057636 000000 BIS @000000(SP),@(SP)+ -whereas mode 6 *does*; eg: +whereas addressing mode 6 *does*; eg: R0=001437 R1=154112 R2=000040 R3=000376 R4=160316 R5=153412 SP=000376 PC=022074 PS=000340 IR=000000 SL=000377 T0 N0 Z0 V0 C0 diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index 776cb856f..7dd79e7ad 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -1775,7 +1775,11 @@ CPUStatePDP11.prototype.pushWord = function(data, fRed) * -------------------- * On the PDP-11/20, stack overflow traps occur when an address below 400 is referenced * by SP in either mode 4 (auto-decrement) or 5 (auto-decrement deferred). The instruction - * is allowed to complete before the trap is issued. + * is allowed to complete before the trap is issued. NOTE: This information comes + * directly from the PDP-11/20 Handbook (1971), but the 11/20 diagnostics apparently only + * test mode 4, not mode 5, because when I removed stack limit checks for mode 5 on the + * 11/70, none of the 11/20 tests complained. So, I still need some independent confirmation + * as to whether ANY models check for stack overflow on mode 5 (auto-decrement deferred). * * On the PDP-11/70, the stack limit register (177774) allows a variable boundary for the * kernel stack.