[Simh] i1401 Bug: Must Strip Parity before Alternate BCD Space Test

Bob Abeles bobabeles at checkerboardsolutions.com
Sun Jun 29 16:57:48 EDT 2008


Now I'm attempting to bring up the 1401 COBOL compiler from the  
"Cincinnati 1401 donation to the Computer History Museum". The first  
step in the process is to copy the PID tape. Attempting to do so  
results in a much smaller "copy" tape with no error indication.

Debugging reveals that the utility routine in the first record of the  
PID tape is recognizing many of the subsequent records on the tape as  
"noise records", so it is skipping them. "Noise records" on 1401  
tapes are less than 14 bytes in size. My understanding is that "noise  
records" could occur due to repositioning of the tape during write  
operations, so 1401 tape I/O routines often included code for  
detecting them. The utility routine detects "noise records" by  
inserting a specially coded character into the input buffer at offset  
+13, reading the record into the buffer, then comparing the character  
at +13 with the special character. If the character has not been  
overwritten by the read, the record is a "noise record" and is  
skipped. The special character is octal 020, the BCD "alternate  
blank" character. Since 1401 tape logic converts "alternate blank"  
characters on tape to octal 000 (BCD blank) in 1401 core when  
operating in BCD mode (even-bit parity), the "alternate blank"  
character should never be read read from tape in BCD mode, and so  
makes an effective test character for "noise records".

The i1401 sim was found to be copying "alternate blank" characters in  
BCD mode without translating them, thereby causing records with a  
blank at offset +13 to be recognized as "noise records". This was  
occurring because code in "i1401_mt.c" was testing for an "alternate  
blank" without masking off the parity bit, so it was missing  
"alternate blank" characters with proper even-bit parity set. Since  
Paul Pierce's tape images are taken from original tapes, they include  
the C or parity channel.

Applying this patch causes the COBOL utility routine to copy the tape  
properly:

BobsG5:~/Desktop babeles$ diff -c i1401_mt_orig.c i1401_mt.c
*** i1401_mt_orig.c     Sun Jun 29 13:49:38 2008
--- i1401_mt.c  Sun Jun 29 13:52:29 2008
***************
*** 25,30 ****
--- 25,31 ----

      mt           7-track magtape

+    29-Jun-08    REA     Strip parity before alternate BCD blank test
      07-Jul-07    RMS     Removed restriction on load-mode binary tape
      28-Jun-07    RMS     Revised read tape mark behavior based on  
real hardware
                           (found by Van Snyder)
***************
*** 266,272 ****
                       }
                   return SCPE_OK;                         /* done */
                   }
!             t = dbuf[i];                                /* get char */
               if (!(flag & MD_BIN) && (t == BCD_ALT))     /* BCD  
mode alt blank? */
                   t = BCD_BLANK;                          /* real  
blank */
               if (flag & MD_WM) {                         /* word mk  
mode? */
--- 267,273 ----
                       }
                   return SCPE_OK;                         /* done */
                   }
!             t = dbuf[i] & CHAR;                         /* get  
char, strip parity */
               if (!(flag & MD_BIN) && (t == BCD_ALT))     /* BCD  
mode alt blank? */
                   t = BCD_BLANK;                          /* real  
blank */
               if (flag & MD_WM) {                         /* word mk  
mode? */

If there's any interest, I also have patches that implement 1401 tape  
parity generation and checking.

Bob Abeles




More information about the Simh mailing list