PiDP-8/I Software

View Ticket
Log In
Ticket Hash: f961906a5c24f5de2e3b51a77394b0ab9755931c
Title: HLT instructions are handled incorrectly
Status: Closed Type: Code Defect
Severity: Critical Priority: Immediate
Subsystem: front panel Resolution: Fixed
Last Modified: 2017-01-21 15:56:43
Version Found In: v20151215+
User Comments:
tangent added on 2017-01-08 03:14:57: (text/x-fossil-wiki)
Given the following test program:

<verbatim>
1        0100  *100                    / start addr
2 00100  7301          CLA CLL IAC     / Link=AC=0, AC++. AC now 1
3 00101  7004  LOOP,   RAL             / rotate the bit left
4 00102  7402          HLT             / wait for user
5 00103  5101          JMP     LOOP    / again
6              $
</verbatim>

There are two related problems:

Running it normally, it hits the HLT instruction with AC=2, as expected. If you press START or CONT to get past the HLT instruction you see AC go to 0.

If you try to run it in SING INST mode to try and figure out what's going wrong, the PC sails straight through the JMP instruction. Since the next value past JMP is 0000, and that means AND AC with 0, that's probably how the AC is getting cleared. However, simply inserting an NOP after the HLT doesn't fix it. It sails through the JMP again and zeroes AC again.

Something about how the modified PiDP-8/I simulator is operating is breaking the JMP instruction handling after a HLT.

This program does work as expected in the stock SIMH <tt>pdp8</tt> simulator as well as in Baehr's PDP-8/E Simulator. This problem affects all versions of the PiDP-8/I simulator tested: v20151215, v20161128, and v20170105.

tangent added on 2017-01-08 15:04:45: (text/x-fossil-plain)
I tried adding a "continue" statement on line 1209 of pdp8_cpu.c.in, but that doesn't fix it. (I thought maybe the problem was all the other code that runs after the swStop=1 line.)

So, the problem is more complicated. Something about the way the simulator normally handles the "reason = STOP_HALT" case differs from the way we handle "swStop == 1".

tangent added on 2017-01-21 15:56:43: (text/x-fossil-plain)
Closed by [9a12773270]