From 4a5d829c46f3532a4c88d8081a905303bafecaf9 Mon Sep 17 00:00:00 2001 From: Bob Supnik Date: Tue, 14 Mar 2017 09:58:17 -0700 Subject: [PATCH] PDP11: Fixed spurious interrupt when setting GO The code wasn't handling interrupts correctly when TCCM was written. In particular, if the GO bit clears DONE, the code looked for the "SET IE" case too soon and didn't clear the interrupt that was incorrectly generated. The new code factors "GO" into the calculation. --- PDP11/pdp11_tc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/PDP11/pdp11_tc.c b/PDP11/pdp11_tc.c index 9ebb30b4..0094abae 100644 --- a/PDP11/pdp11_tc.c +++ b/PDP11/pdp11_tc.c @@ -1,6 +1,6 @@ /* pdp11_tc.c: PDP-11 DECtape simulator - Copyright (c) 1993-2016, Robert M Supnik + Copyright (c) 1993-2017, Robert M Supnik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -25,7 +25,8 @@ tc TC11/TU56 DECtape - 04-Dec-13 RMS Revised to model TCCM correctly (Josh Dersch) + 14-Mar-17 RMS Fixed spurious interrupt when setting GO (Paul Koning) + 04-Dec-16 RMS Revised to model TCCM correctly (Josh Dersch) 23-Oct-13 RMS Revised for new boot setup routine 23-Jun-06 RMS Fixed switch conflict in ATTACH 10-Feb-06 RMS READ sets extended data bits in TCST (Alan Frisbie) @@ -493,7 +494,8 @@ switch (j) { data = (PA & 1)? ((tccm & 0377) | (data << 8)): ((tccm & ~0377) | data); if ((data & CSR_IE) == 0) /* clearing IE? */ CLR_INT (DTA); /* clear intr */ - else if ((tccm & (CSR_DONE|CSR_IE)) == CSR_DONE) /* setting, DON'IE = DON? */ + else if (((tccm & (CSR_DONE|CSR_IE)) == CSR_DONE) && /* set IE, DON'IE = DON? */ + ((data & CSR_GO) == 0)) /* and not setting GO? */ SET_INT (DTA); /* set intr */ tccm = (tccm & ~CSR_RW) | (data & CSR_RW); /* merge data */ if ((data & CSR_GO) != 0) { /* GO (DO) set? */