From 3c081a80c1f97f9ba37a4a292896deaca57ceb7b Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Tue, 28 Apr 2020 14:35:22 -0700 Subject: [PATCH] KA10, KI10, KL10: Open LPT, PTP devices for append This implements the principle of "least surprise", in that users won't normally expect to start overwriting an existing file on these devices. Real hardware didn't behave that way. A new (empty) file can always be created with the -N switch on the ATTACH. --- PDP10/kx10_lp.c | 1 + PDP10/kx10_pt.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/PDP10/kx10_lp.c b/PDP10/kx10_lp.c index ebb625ff..25e2d7cb 100644 --- a/PDP10/kx10_lp.c +++ b/PDP10/kx10_lp.c @@ -393,6 +393,7 @@ t_stat lpt_attach (UNIT *uptr, CONST char *cptr) { t_stat reason; + sim_switches |= SWMASK ('A'); /* Position to EOF */ reason = attach_unit (uptr, cptr); if (sim_switches & SIM_SW_REST) return reason; diff --git a/PDP10/kx10_pt.c b/PDP10/kx10_pt.c index 7f31db81..d5a40089 100644 --- a/PDP10/kx10_pt.c +++ b/PDP10/kx10_pt.c @@ -209,6 +209,7 @@ t_stat ptp_attach (UNIT *uptr, CONST char *cptr) { t_stat reason; + sim_switches |= SWMASK ('A'); /* Default to Append to existing file */ reason = attach_unit (uptr, cptr); uptr->STATUS &= ~NO_TAPE_PP; return reason; @@ -409,6 +410,7 @@ fprintf (st, "Paper Tape Punch (PTP)\n\n"); fprintf (st, "The paper tape punch (PTP) writes data to a disk file. The POS register\n"); fprintf (st, "specifies the number of the next data item to be written. Thus, by changing\n"); fprintf (st, "POS, the user can backspace or advance the punch.\n"); +fprintf (st, "A new file can be created if you attach with the -N switch\n\n"); fprint_set_help (st, dptr); fprint_show_help (st, dptr); fprint_reg_help (st, dptr);