From 34a6388114e18c1e946aeead3104f27da5ab7210 Mon Sep 17 00:00:00 2001 From: Paul Koning Date: Fri, 4 Feb 2022 08:00:07 -0800 Subject: [PATCH] PDP11: Fix bug in KG11 emulation Reported by Reindert Voorhorst: if several bytes/words are processed by the KG11 without intervening status/config register writes, the wrong answer is produced. The issue is a missing reset of the pulse count internal register, which should be cleared by a data register write. The manual (DEC-11-KKGAA-B-D) has the details. --- PDP11/pdp11_kg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/PDP11/pdp11_kg.c b/PDP11/pdp11_kg.c index 90db6d7b..e82c66e5 100644 --- a/PDP11/pdp11_kg.c +++ b/PDP11/pdp11_kg.c @@ -342,6 +342,7 @@ static t_stat kg_wr (int32 data, int32 PA, int32 access) fprintf (sim_deb, ">>KG%d: wr DR %06o, data %06o, PC %06o\n", unit, kg_unit[unit].DR, data, PC); kg_unit[unit].SR &= ~KGSR_M_DONE; + kg_unit[unit].PULSCNT = 0; /* In a typical device, this is normally where we would use sim_activate() to initiate an I/O to be completed later. The KG is a little