simh-testsetgenerator/B5500/sim_card.h
Richard Cornwell 0a33758e47 B5500: Initial checking of simulator for current simh
The B5500 simulator supports the following peripherals.

Two CPUs with between 4K and 32K of memory. The second CPU can be
enabled with "set cpu1 enable". "set cpu1 disable" disables the
second CPU.

Up to 4 floating IO channels. Individual channels can be enabled with
"set io# enable", or "set io# disable".

There are two card readers. The second reader is disabled by default.

There is one Card Punch.

The Card reader and Card Punch support the following options:
  set cr format=

     auto   - will automatically determine the format based on the
              text it recieves.
     text     Text based cards. Tabs are converted to the correct
              number of spaces. A record of
              ~raw octal will enter a binary card.
              ~eor will enter a 7/8/9 punch in column 1.
              ~eof will enter a 6/7/9 punch in column 1.
              ~eoi will enter a 6/7/8/9 punch in column 1.
              ~~ will enter a ~ as the first character.

     bin      Binary Card format:
              Each record 160 characters.
              First characters 6789----
              Second character 21012345
                               111
              Top 4 bits of second character are 0.
              It is unlikely that any other format could
              look like this.

     bcd      BCD Format:
              Each record variable length (80 chars or less).
              Record mark has bit 7 set.
              Bit 6 is even parity.
              Bits 5-0 are character.

    cbn       CBN Format:
              Each record 160 charaters.
              First char has bit 7 set. Rest set to 0.
              Bit 6 is odd parity.
              Bit 5-0 of first character are top 6 bits
                      of card.
              Bit 5-0 of second character are lower 6 bits
                      of card.

    For punch format of auto if the card can't be converted to text it is
    output as a raw record.

 There are two line printers, the second one is disabled by default. The LP
 supports the option "set lp# linesperpage=#" which determines when the
 printer will force out a page break.

 There are up to 16 mag tape drives, the format is controlled by the standard
 simh format control for tapes. These are 6 bit tapes, 1 character per record
 with parity. Units 8-16 are disabled by default.

 There are up to two drum units DR0 and DR1. These can either be attached
 to a file or set to AUXMEM. Setting to AUXMEM causes them to exist only
 during the given simh run. Setting back to DRUM will clear whatever was
 stored on the drum. To enable use of DRUM on XV the following options should
 be turned on "DRA,DRB,CODEOLAY,DATAOLAY". MCP will then use the drum as a
 overlay device instead of the disk system.

 Disks can be attached to the various ESU's, ESU0-9 are on DKA by default,
 ESU10-19 are on DKB. If "set dk1 dfx" is set, then ESU10-19 are not used and
 the disks are shared by both DKA and DKB. To use more then 10 ESU's in a non
 shared mode, a new version of MCP must be created. MCP must be compiled with
 DFX option set to false. For MCP XV DKBNODFX must also be set to true.  ESU units
 can be set to MODI or MODIB. MODIB will double the size of the drive.

 The DTC can be attached to a telnet port with "attach dtc #" to enable dialup
 access to the sim.

The loader card for the card reader is:
~raw0104441100204231524012004000004444550211002041317700000000000024045303040243
00050000006501004131011041310055005500000062005042310000006600304231000000720010
42310000007675610165001002310010413100040107202500440106202533554061256520252265
20251765202514655355536117650000004401062025155522610165225572610465044101160500
4131

  This card should be all in one line.
2016-02-06 15:51:04 -05:00

113 lines
4.5 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* Card read/punch routines for 7000 simulators.
Copyright (c) 2005, Richard Cornwell
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
ROBERT M SUPNIK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This is the standard card reader.
This is the standard card punch.
Input formats are accepted in a variaty of formats:
Standard ASCII: one record per line.
returns are ignored.
tabs are expanded to modules 8 characters.
~ in first column is treated as a EOF.
Binary Card format:
Each record 160 characters.
First character 21012345
111
Second characters 6789----
Top 4 bits of second character are 0.
It is unlikely that ascii text or BCD format
text could produce similar profile.
BCD Format:
Each record variable length (80 chars or less).
Record mark has bit 7 set.
Bit 6 is even parity.
Bits 5-0 are character.
CBN Format:
Each record 160 charaters.
First char has bit 7 set. Rest set to 0.
Bit 6 is odd parity.
Bit 5-0 of first character are top 6 bits
of card.
Bit 5-0 of second character are lower 6 bits
of card.
For autodetection of BCD card format, there can be no parity errors.
All undeterminate formats are treated as ASCII.
Auto output format is ASCII if card has only printable characters
or card format binary.
*/
#define DEBUG_CARD 0x0000010 /* Show details */
/* Flags for punch and reader. */
#define UNIT_V_MODE (UNIT_V_UF + 0)
#define UNIT_MODE (7 << UNIT_V_MODE)
#define MODE_AUTO (0 << UNIT_V_MODE)
#define MODE_BIN (1 << UNIT_V_MODE)
#define MODE_TEXT (2 << UNIT_V_MODE)
#define MODE_BCD (3 << UNIT_V_MODE)
#define MODE_CBN (4 << UNIT_V_MODE)
/* Allow lower case letters */
#define MODE_LOWER (8 << UNIT_V_MODE)
#define MODE_026 (0x10 << UNIT_V_MODE)
#define MODE_029 (0x20 << UNIT_V_MODE)
#define MODE_EBCDIC (0x30 << UNIT_V_MODE)
#define MODE_CHAR (0x30 << UNIT_V_MODE)
struct _card_data
{
int ptr; /* Pointer in buffer */
int len; /* Length of buffer */
char cbuff[1024]; /* Read in buffer for cards */
uint16 image[80]; /* Image */
uint8 hol_to_ascii[4096]; /* Back conversion table */
};
/* Generic routines. */
t_stat sim_read_card(UNIT * uptr);
int sim_card_eof(UNIT * uptr);
t_stat sim_punch_card(UNIT * uptr, UNIT *stkptr);
t_stat sim_card_attach(UNIT * uptr, char *file);
t_stat sim_card_detach(UNIT *uptr);
/* Conversion routines to save code */
uint16 sim_bcd_to_hol(uint8 bcd);
uint16 sim_ebcdic_to_hol(uint8 ebcdic);
uint8 sim_hol_to_bcd(uint16 hol);
uint8 sim_hol_to_ebbcd(uint16 hol);
/* Format control routines. */
t_stat sim_card_set_fmt (UNIT *uptr, int32 val, char *cptr, void *desc);
t_stat sim_card_show_fmt (FILE *st, UNIT *uptr, int32 val, void *desc);
/* Help information */
t_stat sim_card_attach_help(FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, const char *cptr);
/* Translation tables */
const char sim_six_to_ascii[64];
const char sim_ascii_to_six[128];
const uint8 sim_parity_table[64];