[Simh] i1401 Bug: ZA and ZS Source Operand Space Character Handling
Bob Abeles
bobabeles at checkerboardsolutions.com
Fri Jun 27 19:05:02 EDT 2008
On 6/25/08, Paul Pierce posted 5 newly converted 1401 tape images
from the "Cincinnati 1401 donation to the Computer History Museum".
One of the tapes is a 1401 Autocoder V3 distribution tape.
The tape can be found here: http://www.piercefuller.com/library/
cincinnati-h.html
While attempting to build a system tape from the image, I ran into
difficulties where a spurious "sequence error" message occurs. Here
is the text of the message as it appears on the printer:
^^^^^^^^^;^^^^^^^^^;^^^^^^^^^;^^^^^^^^^L030527,508518,040040,04004010400
36037233 SEQUENCE^ERROR
The root cause is an error in the implementation of the ZA and ZS
instructions in "IBM 1401 simulator V3.8-0" and likely earlier
versions. Specifically, the implementation translates each source
character from binary to BCD, replacing blank characters with zeros.
"A24-1403-5 1401 Reference Manual" and "R25-1495 1401 Instruction
Logic" indicate that the qui-binary adder and its associated
translation circuits are not used by these instructions and that zone
bits are simply stripped from source operand characters. Correcting
the implementation caused system tape generation to function properly.
Here is the source code patch:
bobspb:~/Historical/IBM_1401/simh-build/i1401 rabeles$ diff -c
i1401_cpu_orig.c i1401_cpu.c
*** i1401_cpu_orig.c Sat Jul 7 14:39:38 2007
--- i1401_cpu.c Fri Jun 27 15:58:47 2008
***************
*** 23,28 ****
--- 23,29 ----
used in advertising or otherwise to promote the sale, use or
other dealings
in this Software without prior written authorization from
Robert M Supnik.
+ 27-Jun-08 REA Fixed ZA/ZS bug, should not convert source
to BCD
07-Jul-07 RMS Removed restriction on load-mode binary tape
28-Jun-07 RMS Added support for SS overlap modifiers
22-May-06 RMS Fixed format error in CPU history (found
by Peter Schorn)
***************
*** 868,874 ****
if (a & WM) wm = M[BS] = (M[BS] & WM) | BCD_ZERO;
else {
a = M[AS]; /* get A
char */
! t = (a & CHAR)? bin_to_bcd[a & DIGIT]: 0;
wm = M[BS] = (M[BS] & WM) | t; /* move
digit */
MM (AS);
}
--- 869,875 ----
if (a & WM) wm = M[BS] = (M[BS] & WM) | BCD_ZERO;
else {
a = M[AS]; /* get A
char */
! t = a & DIGIT; /* isolate
digit bits */
wm = M[BS] = (M[BS] & WM) | t; /* move
digit */
MM (AS);
}
Bob Abeles
More information about the Simh
mailing list