simh-testsetgenerator/I1620/i1620_defs.h
Bob Supnik 2c2dd5ea33 Notes For V2.10-0
WARNING: V2.10 has reorganized and renamed some of the definition
files for the PDP-10, PDP-11, and VAX.  Be sure to delete all
previous source files before you unpack the Zip archive, or
unpack it into a new directory structure.

WARNING: V2.10 has a new, more comprehensive save file format.
Restoring save files from previous releases will cause 'invalid
register' errors and loss of CPU option flags, device enable/
disable flags, unit online/offline flags, and unit writelock
flags.

WARNING: If you are using Visual Studio .NET through the IDE,
be sure to turn off the /Wp64 flag in the project settings, or
dozens of spurious errors will be generated.

WARNING: Compiling Ethernet support under Windows requires
extra steps; see the Ethernet readme file.  Ethernet support is
currently available only for Windows, Linux, NetBSD, and OpenBSD.

1. New Features

1.1 SCP and Libraries

- The VT emulation package has been replaced by the capability
  to remote the console to a Telnet session.  Telnet clients
  typically have more complete and robust VT100 emulation.
- Simulated devices may now have statically allocated buffers,
  in addition to dynamically allocated buffers or disk-based
  data stores.
- The DO command now takes substitutable arguments (max 9).
  In command files, %n represents substitutable argument n.
- The initial command line is now interpreted as the command
  name and substitutable arguments for a DO command.  This is
  backward compatible to prior versions.
- The initial command line parses switches.  -Q is interpreted
  as quiet mode; informational messages are suppressed.
- The HELP command now takes an optional argument.  HELP <cmd>
  types help on the specified command.
- Hooks have been added for implementing GUI-based consoles,
  as well as simulator-specific command extensions.  A few
  internal data structures and definitions have changed.
- Two new routines (tmxr_open_master, tmxr_close_master) have
  been added to sim_tmxr.c.  The calling sequence for
  sim_accept_conn has been changed in sim_sock.c.
- The calling sequence for the VM boot routine has been modified
  to add an additional parameter.
- SAVE now saves, and GET now restores, controller and unit flags.
- Library sim_ether.c has been added for Ethernet support.

1.2 VAX

- Non-volatile RAM (NVR) can behave either like a memory or like
  a disk-based peripheral.  If unattached, it behaves like memory
  and is saved and restored by SAVE and RESTORE, respectively.
  If attached, its contents are loaded from disk by ATTACH and
  written back to disk at DETACH and EXIT.
- SHOW <device> VECTOR displays the device's interrupt vector.
  A few devices allow the vector to be changed with SET
  <device> VECTOR=nnn.
- SHOW CPU IOSPACE displays the I/O space address map.
- The TK50 (TMSCP tape) has been added.
- The DEQNA/DELQA (Qbus Ethernet controllers) have been added.
- Autoconfiguration support has been added.
- The paper tape reader has been removed from vax_stddev.c and
  now references a common implementation file, dec_pt.h.
- Examine and deposit switches now work on all devices, not just
  the CPU.
- Device address conflicts are not detected until simulation starts.

1.3 PDP-11

- SHOW <device> VECTOR displays the device's interrupt vector.
  Most devices allow the vector to be changed with SET
  <device> VECTOR=nnn.
- SHOW CPU IOSPACE displays the I/O space address map.
- The TK50 (TMSCP tape), RK611/RK06/RK07 (cartridge disk),
  RX211 (double density floppy), and KW11P programmable clock
  have been added.
- The DEQNA/DELQA (Qbus Ethernet controllers) have been added.
- Autoconfiguration support has been added.
- The paper tape reader has been removed from pdp11_stddev.c and
  now references a common implementation file, dec_pt.h.
- Device bootstraps now use the actual CSR specified by the
  SET ADDRESS command, rather than just the default CSR.  Note
  that PDP-11 operating systems may NOT support booting with
  non-standard addresses.
- Specifying more than 256KB of memory, or changing the bus
  configuration, causes all peripherals that are not compatible
  with the current bus configuration to be disabled.
- Device address conflicts are not detected until simulation starts.

1.4 PDP-10

- SHOW <device> VECTOR displays the device's interrupt vector.
  A few devices allow the vector to be changed with SET
  <device> VECTOR=nnn.
- SHOW CPU IOSPACE displays the I/O space address map.
- The RX211 (double density floppy) has been added; it is off
  by default.
- The paper tape now references a common implementation file,
  dec_pt.h.
- Device address conflicts are not detected until simulation starts.

1.5 PDP-1

- DECtape (then known as MicroTape) support has been added.
- The line printer and DECtape can be disabled and enabled.

1.6 PDP-8

- The RX28 (double density floppy) has been added as an option to
  the existing RX8E controller.
- SHOW <device> DEVNO displays the device's device number.  Most
  devices allow the device number to be changed with SET <device>
  DEVNO=nnn.
- Device number conflicts are not detected until simulation starts.

1.7 IBM 1620

- The IBM 1620 simulator has been released.

1.8 AltairZ80

- A hard drive has been added for increased storage.
- Several bugs have been fixed.

1.9 HP 2100

- The 12845A has been added and made the default line printer (LPT).
  The 12653A has been renamed LPS and is off by default.  It also
  supports the diagnostic functions needed to run the DCPC and DMS
  diagnostics.
- The 12557A/13210A disk defaults to the 13210A (7900/7901).
- The 12559A magtape is off by default.
- New CPU options (EAU/NOEAU) enable/disable the extended arithmetic
  instructions for the 2116.  These instructions are standard on
  the 2100 and 21MX.
- New CPU options (MPR/NOMPR) enable/disable memory protect for the
  2100 and 21MX.
- New CPU options (DMS/NODMS) enable/disable the dynamic mapping
  instructions for the 21MX.
- The 12539 timebase generator autocalibrates.

1.10 Simulated Magtapes

- Simulated magtapes recognize end of file and the marker
  0xFFFFFFFF as end of medium.  Only the TMSCP tape simulator
  can generate an end of medium marker.
- The error handling in simulated magtapes was overhauled to be
  consistent through all simulators.

1.11 Simulated DECtapes

- Added support for RT11 image file format (256 x 16b) to DECtapes.

2. Release Notes

2.1 Bugs Fixed

- TS11/TSV05 was not simulating the XS0_MOT bit, causing failures
  under VMS.  In addition, two of the CTL options were coded
  interchanged.
- IBM 1401 tape was not setting a word mark under group mark for
  load mode reads.  This caused the diagnostics to crash.
- SCP bugs in ssh_break and set_logon were fixed (found by Dave
  Hittner).
- Numerous bugs in the HP 2100 extended arithmetic, floating point,
  21MX, DMS, and IOP instructions were fixed.  Bugs were also fixed
  in the memory protect and DMS functions.  The moving head disks
  (DP, DQ) were revised to simulate the hardware more accurately.
  Missing functions in DQ (address skip, read address) were added.

2.2 HP 2100 Debugging

- The HP 2100 CPU nows runs all of the CPU diagnostics.
- The peripherals run most of the peripheral diagnostics.  There
  is still a problem in overlapped seek operation on the disks.
  See the file hp2100_diag.txt for details.

3. In Progress

These simulators are not finished and are available in a separate
Zip archive distribution.

- Interdata 16b/32b: coded, partially tested.  See the file
  id_diag.txt for details.
- SDS 940: coded, partially tested.
2011-04-15 08:33:49 -07:00

221 lines
9 KiB
C

/* i1620_defs.h: IBM 1620 simulator definitions
Copyright (c) 2002, Robert M. Supnik
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.
Except as contained in this notice, the name of Robert M Supnik shall not
be used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from Robert M Supnik.
This simulator is based on the 1620 simulator written by Geoff Kuenning.
I am grateful to Al Kossow, the Computer History Museum, and the IBM Corporate
Archives for their help in gathering documentation about the IBM 1620.
18-Oct-02 RMS Fixed bug in ADDR_S macro (found by Hans Pufal)
*/
#include "sim_defs.h" /* simulator defns */
/* Simulator stop codes */
#define STOP_HALT 1 /* HALT */
#define STOP_IBKPT 2 /* breakpoint */
#define STOP_INVINS 3 /* invalid instruction */
#define STOP_INVDIG 4 /* invalid digit */
#define STOP_INVCHR 5 /* invalid char */
#define STOP_INVIND 6 /* invalid indicator */
#define STOP_INVPDG 7 /* invalid P addr digit */
#define STOP_INVPAD 8 /* invalid P addr */
#define STOP_INVPIA 9 /* invalid P indir addr */
#define STOP_INVQDG 10 /* invalid Q addr digits */
#define STOP_INVQAD 11 /* invalid Q addr */
#define STOP_INVQIA 12 /* invalid Q indir addr */
#define STOP_INVIO 13 /* invalid IO address */
#define STOP_INVRTN 14 /* invalid return */
#define STOP_INVFNC 15 /* invalid function */
#define STOP_INVIAD 16 /* invalid instr addr */
#define STOP_INVSEL 17 /* invalid select */
#define STOP_INVIDX 18 /* invalid index instr */
#define STOP_INVEAD 19 /* invalid even addr */
#define STOP_INVDCF 20 /* invalid DCF addr */
#define STOP_INVDRV 21 /* invalid disk drive */
#define STOP_INVDSC 22 /* invalid disk sector */
#define STOP_INVDCN 23 /* invalid disk count */
#define STOP_INVDBA 24 /* invalid disk buf addr */
#define STOP_DACERR 25 /* disk addr comp err */
#define STOP_DWCERR 26 /* disk wr check err */
#define STOP_CYOERR 27 /* cylinder ovflo err */
#define STOP_WRLERR 28 /* wrong rec lnt err */
#define STOP_CCT 29 /* runaway CCT */
#define STOP_FWRAP 30 /* field wrap */
#define STOP_RWRAP 31 /* record wrap */
#define STOP_NOCD 32 /* no card in reader */
#define STOP_OVERFL 33 /* overflow */
#define STOP_EXPCHK 34 /* exponent error */
#define STOP_WRADIS 35 /* write addr disabled */
#define STOP_FPLNT 36 /* invalid fp length */
#define STOP_FPUNL 37 /* fp lengths unequal */
#define STOP_FPMF 38 /* no flag on exp */
#define STOP_FPDVZ 39 /* divide by zero */
/* Memory */
#define MAXMEMSIZE 60000 /* max mem size */
#define MEMSIZE (cpu_unit.capac) /* act memory size */
/* Processor parameters */
#define INST_LEN 12 /* inst length */
#define ADDR_LEN 5 /* addr length */
#define MUL_TABLE 100 /* multiply table */
#define MUL_TABLE_LEN 200
#define ADD_TABLE 300 /* add table */
#define ADD_TABLE_LEN 100
#define IDX_A 300 /* index A base */
#define IDX_B 340 /* index B base */
#define PROD_AREA 80 /* product area */
#define PROD_AREA_LEN 20 /* product area */
#define PROD_AREA_END (PROD_AREA + PROD_AREA_LEN)
/* Branch indicator codes */
#define NUM_IND 100 /* number of indicators */
#define IN_SW1 1 /* sense switch 1 */
#define IN_SW2 2 /* sense switch 2 */
#define IN_SW3 3 /* sense switch 3 */
#define IN_SW4 4 /* sense switch 4 */
#define IN_RDCHK 6 /* read check (I/O error) */
#define IN_WRCHK 7 /* write check (I/O error) */
#define IN_LAST 9 /* last card was just read */
#define IN_HP 11 /* high or positive result */
#define IN_EZ 12 /* equal or zero result */
#define IN_HPEZ 13 /* high/positive or equal/zero */
#define IN_OVF 14 /* overflow */
#define IN_EXPCHK 15 /* floating exponent check */
#define IN_MBREVEN 16 /* even parity check */
#define IN_MBRODD 17 /* odd parity check */
#define IN_ANYCHK 19 /* any of read, write, even/odd */
#define IN_PRCHK 25 /* printer check */
#define IN_IXN 30 /* IX neither */
#define IN_IXA 31 /* IX A band */
#define IN_IXB 32 /* IX B band */
#define IN_PRCH9 33 /* printer chan 9 */
#define IN_PRCH12 34 /* printer chan 12 */
#define IN_PRBSY 35 /* printer busy */
#define IN_DACH 36 /* disk addr/data check */
#define IN_DWLR 37 /* disk rec length */
#define IN_DCYO 38 /* disk cyl overflow */
#define IN_DERR 39 /* disk any error */
/* I/O channel codes */
#define NUM_IO 100 /* number of IO chan */
#define IO_TTY 1 /* console typewriter */
#define IO_PTP 2 /* paper-tape punch */
#define IO_PTR 3 /* paper-tape reader */
#define IO_CDP 4 /* card punch */
#define IO_CDR 5 /* card reader */
#define IO_DSK 7 /* disk */
#define IO_LPT 9 /* line printer */
#define IO_BTP 32 /* binary ptp */
#define IO_BTR 33 /* binary ptr */
#define LPT_WIDTH 120 /* line print width */
#define CCT_LNT 132 /* car ctrl length */
#define CRETIOE(f,c) return ((f)? (c): SCPE_OK)
/* Memory representation: flag + BCD digit per byte */
#define FLAG 0x10
#define DIGIT 0x0F
#define REC_MARK 0xA
#define NUM_BLANK 0xC
#define GRP_MARK 0xF
#define BAD_DIGIT(x) ((x) > 9)
/* Instruction format */
#define I_OP 0 /* opcode */
#define I_P 2 /* P start */
#define I_PL 6 /* P end */
#define I_Q 7 /* Q start */
#define I_QL 11 /* Q end */
#define I_IO 8 /* IO select */
#define I_BR 8 /* indicator select */
#define I_CTL 10 /* control select */
#define I_SEL 11 /* BS select */
#define ADDR_A(x,a) ((((x) + (a)) >= MEMSIZE)? ((x) + (a) - MEMSIZE): ((x) + (a)))
#define ADDR_S(x,a) (((x) < (a))? ((x) - (a) + MEMSIZE): ((x) - (a)))
#define PP(x) x = ADDR_A(x,1)
#define MM(x) x = ADDR_S(x,1)
/* CPU options, stored in cpu_unit.flags */
/* Decoding flags must be part of the same definition set */
#define UNIT_SCP ((1 << UNIT_V_UF) - 1) /* mask of SCP flags */
#define IF_MII (1 << (UNIT_V_UF + 0)) /* model 2 */
#define IF_DIV (1 << (UNIT_V_UF + 1)) /* automatic divide */
#define IF_IA (1 << (UNIT_V_UF + 2)) /* indirect addressing */
#define IF_EDT (1 << (UNIT_V_UF + 3)) /* edit */
#define IF_FP (1 << (UNIT_V_UF + 4)) /* floating point */
#define IF_BIN (1 << (UNIT_V_UF + 5)) /* binary */
#define IF_IDX (1 << (UNIT_V_UF + 6)) /* indexing */
#define IF_VPA (1 << (UNIT_V_UF + 7)) /* valid P addr */
#define IF_VQA (1 << (UNIT_V_UF + 8)) /* valid Q addr */
#define IF_4QA (1 << (UNIT_V_UF + 9)) /* 4 char Q addr */
#define IF_NQX (1 << (UNIT_V_UF + 10)) /* no Q indexing */
#define IF_IMM (1 << (UNIT_V_UF + 11)) /* immediate */
#define UNIT_BCD (1 << (UNIT_V_UF + 12)) /* BCD coded */
#define UNIT_MSIZE (1 << (UNIT_V_UF + 13)) /* fake flag */
#define ALLOPT (IF_DIV + IF_IA + IF_EDT + IF_FP + IF_BIN + IF_IDX)
#define MI_OPT (IF_DIV + IF_IA + IF_EDT + IF_FP)
#define MI_STD (IF_DIV + IF_IA + IF_EDT)
#define MII_OPT (ALLOPT)
#define MII_STD (IF_DIV + IF_IA + IF_EDT + IF_BIN + IF_IDX)
/* Add status codes */
#define ADD_NOCRY 0 /* no carry out */
#define ADD_CARRY 1 /* carry out */
#define ADD_SIGNC 2 /* sign change */
/* Opcodes */
enum opcodes {
OP_FADD = 1, OP_FSUB, OP_FMUL, /* 00 - 09 */
OP_FSL = 5, OP_TFL, OP_BTFL, OP_FSR, OP_FDIV,
OP_BTAM = 10, OP_AM, OP_SM, OP_MM, OP_CM, /* 10 - 19 */
OP_TDM, OP_TFM, OP_BTM, OP_LDM, OP_DM,
OP_BTA = 20, OP_A, OP_S, OP_M, OP_C, /* 20 - 29 */
OP_TD, OP_TF, OP_BT, OP_LD, OP_D,
OP_TRNM = 30, OP_TR, OP_SF, OP_CF, OP_K, /* 30 - 39 */
OP_DN, OP_RN, OP_RA, OP_WN, OP_WA,
OP_NOP = 41, OP_BB, OP_BD, OP_BNF, /* 40 - 49 */
OP_BNR, OP_BI, OP_BNI, OP_H, OP_B,
OP_BNG = 55,
OP_BS = 60, OP_BX, OP_BXM, OP_BCX, OP_BCXM, /* 60 - 69 */
OP_BLX, OP_BLXM, OP_BSX,
OP_MA = 70, OP_MF, OP_TNS, OP_TNF, /* 70 - 79 */
/* 80 - 89 */
OP_BBT = 90, OP_BMK, OP_ORF, OP_ANDF, OP_CPLF, /* 90 - 99 */
OP_EORF, OP_OTD, OP_DTO };