[Simh] Question about card readers.
Bob Supnik
bob at supnik.org
Thu May 26 12:24:36 EDT 2016
There is a proposed card reader library (not mine) in the GitHub
repository, which you could try.
On the 1401, the handling is as follows:
1. The card reader buffer is 2*CBUFSIZE + 1, where CBUFSIZE is an
internal SimH constant for buffer size. The buffer is zeroed before a read.
2. The card is read with fgets (buf, CBUFSIZE/2*CBUFSIZE, file),
depending on whether the data is text or column binary. This guarantees
that there is a null at the end of the string, because the buffer is one
character longer than the maximum read.
3. The card reader then picks up 80/160 characters to process and
discards the rest.
The 7094 card reader behaves the same way.
So...
If the line is less than 256 characters, it is read in its entirety. Any
characters beyond 80/160 are discarded.
If the line is 256 characters or more, 255 characters are read. Any
characters beyond 80/160 are discarded. However, the rest of the line
will be read by the next "read card".
In general, card lines are expected to be no more than 80 characters
(text) or 160 characters (column binary). If presented with a long input
line, the card reader simulator can do what it wants, but I think
discarding the excess characters is correct.
I'm not in favor of putting metadata into card files. Multiple stackers
can be implemented by having a separate file for each stacker bin.
In general, card readers were very rare on DEC equipment, and card
punches even more so - even on PDP-10s.
/Bob
On 5/26/2016 12:00 PM, simh-request at trailing-edge.com wrote:
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 25 May 2016 18:07:15 -0400
> From: Richard Cornwell<skyvis at sky-visions.com>
> To:simh at trailing-edge.com
> Subject: [Simh] Question about card readers.
> Message-ID: <20160525180715.56de6419 at hobbit>
> Content-Type: text/plain; charset=US-ASCII
>
> Hello all,
>
> I am asking for feedback on how to handle Punched card input. I am
> wondering about how to handle the case of reading a greater then 80
> character record on a 80 character punch card. Should characters
> beyond the end of the card be truncated, or should they continue on
> the next card.
>
> Any ideas?
>
> Rich
More information about the Simh
mailing list