From 7c3b293ecf0446930e5b4ab55ab390f01f009dc0 Mon Sep 17 00:00:00 2001 From: Ken Rector Date: Mon, 30 Jan 2023 05:22:42 -1000 Subject: [PATCH] SDS: Fix CR device to properly update status after a disconnect EOM Experimentation with the SDS 9 Series Algol compiler found a problem in the card reader. The Algol card input function reads a complete card with the usual EOM and WIM loop followed by a disconnect EOM. A final service is requested after the last column is read to signal that the card has passed through the reader. If the disconnect EOM occurs before this service, it cancels it and shuts down the request as it ought to. However, the disconnect EOM does not reset the status READING flag and a subsequent Reader Ready Test fails and loops waiting for the disconnected reader to become ready. This change fixes the disconnect EOM case to reset the uptr->STATUS and end of record flag, cr_eor. --- SDS/sds_cr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SDS/sds_cr.c b/SDS/sds_cr.c index 20206a8a..386fc5bd 100644 --- a/SDS/sds_cr.c +++ b/SDS/sds_cr.c @@ -220,6 +220,8 @@ t_stat cr_devio (uint32 fnc, uint32 inst, uint32 *dat) { case IO_DISC: /* disconnect */ xfr_req = xfr_req & ~XFR_CR; /* clr xfr flag */ sim_cancel (uptr); /* deactivate unit */ + cr_eor = 0; + uptr->STATUS = 0; break; case IO_SKS: /* SKS */ new_ch = I_GETSKCH (inst); /* get chan # */