1
0
mirror of https://github.com/open-simh/simh.git synced 2026-04-25 11:51:32 +00:00

Notes For V2.10-2

1. New Features in 2.10-2

The build procedures have changed.  There is only one UNIX makefile.
To compile without Ethernet support, simply type

	gmake {target|all}

To compile with Ethernet support, type

	gmake USE_NETWORK=1 {target|all}

The Mingw batch files require Mingw release 2 and invoke the Unix
makefile.  There are still separate batch files for compilation
with or without Ethernet support.

1.1 SCP and Libraries

- The EVAL command will evaluate a symbolic type-in and display
  it in numeric form.
- The ! command (with no arguments) will launch the host operating
  system command shell.  The ! command (with an argument) executes
  the argument as a host operating system command.  (Code from
  Mark Pizzolato)
- Telnet sessions now recognize BREAK.  How a BREAK is transmitted
  dependent on the particular Telnet client.  (Code from Mark
  Pizzolato)
- The sockets library includes code for active connections as
  well as listening connections.
- The RESTORE command will restore saved memory size, if the
  simulator supports dynamic memory resizing.

1.2 PDP-1

- The PDP-1 supports the Type 24 serial drum (based on recently
  discovered documents).

1.3 18b PDP's

- The PDP-4 supports the Type 24 serial drum (based on recently
  discovered documents).

1.4 PDP-11

- The PDP-11 implements a stub DEUNA/DELUA (XU).  The real XU
  module will be included in a later release.

1.5 PDP-10

- The PDP-10 implements a stub DEUNA/DELUA (XU).  The real XU
  module will be included in a later release.

1.6 HP 2100

- The IOP microinstruction set is supported for the 21MX as well
  as the 2100.
- The HP2100 supports the Access Interprocessor Link (IPL).

1.7 VAX

- If the VAX console is attached to a Telnet session, BREAK is
  interpreted as console halt.
- The SET/SHOW HISTORY commands enable and display a history of
  the most recently executed instructions.  (Code from Mark
  Pizzolato)

1.8 Terminals Multiplexors

- BREAK detection was added to the HP, DEC, and Interdata terminal
  multiplexors.

1.9 Interdata 16b and 32b

- First release.  UNIX is not yet working.

1.10 SDS 940

- First release.

2. Bugs Fixed in 2.10-2

- PDP-11 console must default to 7b for early UNIX compatibility.
- PDP-11/VAX TMSCP emulator was using the wrong packet length for
  read/write end packets.
- Telnet IAC+IAC processing was fixed, both for input and output
  (found by Mark Pizzolato).
- PDP-11/VAX Ethernet setting flag bits wrong for chained
  descriptors (found by Mark Pizzolato).

3. New Features in 2.10 vs prior releases

3.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.

3.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.

3.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.

3.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.

3.5 PDP-1

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

3.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.

3.7 IBM 1620

- The IBM 1620 simulator has been released.

3.8 AltairZ80

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

3.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.

3.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.

3.11 Simulated DECtapes

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

4. Bugs Fixed in 2.10 vs prior releases

- 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.
- PDP-10 tape wouldn't boot, and then wouldn't read (reported by
  Michael Thompson and Harris Newman, respectively)
- PDP-1 typewriter is half duplex, with only one shift state for
  both input and output (found by Derek Peschel)

5. General Notes

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.
This commit is contained in:
Bob Supnik
2003-01-17 18:35:00 -08:00
committed by Mark Pizzolato
parent 4ea745b3ad
commit 2bcd1e7c4c
206 changed files with 30253 additions and 12114 deletions

View File

@@ -521,7 +521,7 @@ unit = (t == BCD_ZERO)? 0: t; /* save char as unit */
xa = (AS >> V_INDEX) & M_INDEX; /* get index reg */
if (xa && (D != BCD_PERCNT) && (cpu_unit.flags & XSA)) { /* indexed? */
AS = AS + hun_table[M[xa] & CHAR] + ten_table[M[xa + 1] & CHAR] +
one_table[M[xa + 2] & CHAR];
one_table[M[xa + 2] & CHAR];
AS = (AS & INDEXMASK) % MAXMEMSIZE; }
if (!(flags & MLS)) BS = AS; /* not MLS? B = A */
PP (IS);
@@ -544,8 +544,8 @@ if ((t = M[IS]) & WM) { /* WM? 6 char inst */
BS = BS + one_table[t]; /* finish B addr */
xa = (BS >> V_INDEX) & M_INDEX; /* get index reg */
if (xa && (cpu_unit.flags & XSA)) { /* indexed? */
BS = BS + hun_table[M[xa] & CHAR] + ten_table[M[xa + 1] & CHAR]
+ one_table[M[xa + 2] & CHAR];
BS = BS + hun_table[M[xa] & CHAR] + ten_table[M[xa + 1] & CHAR] +
one_table[M[xa + 2] & CHAR];
BS = (BS & INDEXMASK) % MAXMEMSIZE; }
PP (IS);
@@ -580,55 +580,65 @@ switch (op) { /* case on opcode */
case OP_MCW: /* move char */
if (ilnt >= 8) { /* I/O form? */
reason = iodisp (dev, unit, MD_NORM, D);
break; }
reason = iodisp (dev, unit, MD_NORM, D);
break; }
if (ADDR_ERR (AS)) { /* check A addr */
reason = STOP_INVA;
break; }
do { M[BS] = (M[BS] & WM) | (M[AS] & CHAR); /* move char */
wm = M[AS] | M[BS];
MM (AS); MM (BS); } /* decr pointers */
reason = STOP_INVA;
break; }
do {
M[BS] = (M[BS] & WM) | (M[AS] & CHAR); /* move char */
wm = M[AS] | M[BS];
MM (AS); MM (BS); } /* decr pointers */
while ((wm & WM) == 0); /* stop on A,B WM */
break;
case OP_LCA: /* load char */
if (ilnt >= 8) { /* I/O form? */
reason = iodisp (dev, unit, MD_WM, D);
break; }
reason = iodisp (dev, unit, MD_WM, D);
break; }
if (ADDR_ERR (AS)) { /* check A addr */
reason = STOP_INVA;
break; }
do { wm = M[BS] = M[AS]; /* move char + wmark */
MM (AS); MM (BS); } /* decr pointers */
reason = STOP_INVA;
break; }
do {
wm = M[BS] = M[AS]; /* move char + wmark */
MM (AS); MM (BS); } /* decr pointers */
while ((wm & WM) == 0); /* stop on A WM */
break;
case OP_MCM: /* move to rec/group */
do { M[BS] = (M[BS] & WM) | (M[AS] & CHAR); /* move char */
t = M[AS];
PP (AS); PP (BS); } /* incr pointers */
do {
M[BS] = (M[BS] & WM) | (M[AS] & CHAR); /* move char */
t = M[AS];
PP (AS); PP (BS); } /* incr pointers */
while (((t & CHAR) != BCD_RECMRK) && (t != (BCD_GRPMRK + WM)));
break;
case OP_MSZ: /* move suppress zero */
bsave = BS; /* save B start */
qzero = 1; /* set suppress */
do { M[BS] = M[AS] & ((BS != bsave)? CHAR: DIGIT); /* copy char */
wm = M[AS];
MM (AS); MM (BS); } /* decr pointers */
do {
M[BS] = M[AS] & ((BS != bsave)? CHAR: DIGIT); /* copy char */
wm = M[AS];
MM (AS); MM (BS); } /* decr pointers */
while ((wm & WM) == 0); /* stop on A WM */
if (reason) break; /* addr err? stop */
do { PP (BS); /* adv B */
t = M[BS]; /* get B, cant be WM */
if ((t == BCD_ZERO) || (t == BCD_COMMA)) {
if (qzero) M[BS] = 0; }
else if ((t == BCD_BLANK) || (t == BCD_MINUS)) ;
else if (((t == BCD_DECIMAL) && (cpu_unit.flags & EPE)) ||
(t <= BCD_NINE)) qzero = 0;
else qzero = 1; }
do {
PP (BS); /* adv B */
t = M[BS]; /* get B, cant be WM */
if ((t == BCD_ZERO) || (t == BCD_COMMA)) {
if (qzero) M[BS] = 0; }
else if ((t == BCD_BLANK) || (t == BCD_MINUS)) ;
else if (((t == BCD_DECIMAL) && (cpu_unit.flags & EPE)) ||
(t <= BCD_NINE)) qzero = 0;
else qzero = 1; }
while (BS <= bsave);
break;
case OP_MN: /* move numeric */
M[BS] = (M[BS] & ~DIGIT) | (M[AS] & DIGIT); /* move digit */
MM (AS); MM (BS); /* decr pointers */
break;
case OP_MZ: /* move zone */
M[BS] = (M[BS] & ~ZONE) | (M[AS] & ZONE); /* move high bits */
MM (AS); MM (BS); /* decr pointers */
@@ -641,23 +651,24 @@ case OP_MZ: /* move zone */
case OP_C: /* compare */
if (ilnt != 1) { /* if not chained */
ind[IN_EQU] = 1; /* clear indicators */
ind[IN_UNQ] = ind[IN_HGH] = ind[IN_LOW] = 0; }
do { a = M[AS]; /* get characters */
b = M[BS];
wm = a | b; /* get word marks */
if ((a & CHAR) != (b & CHAR)) { /* unequal? */
ind[IN_EQU] = 0; /* set indicators */
ind[IN_UNQ] = 1;
ind[IN_HGH] = col_table[b & CHAR] > col_table [a & CHAR];
ind[IN_LOW] = ind[IN_HGH] ^ 1; }
MM (AS); MM (BS); } /* decr pointers */
ind[IN_EQU] = 1; /* clear indicators */
ind[IN_UNQ] = ind[IN_HGH] = ind[IN_LOW] = 0; }
do {
a = M[AS]; /* get characters */
b = M[BS];
wm = a | b; /* get word marks */
if ((a & CHAR) != (b & CHAR)) { /* unequal? */
ind[IN_EQU] = 0; /* set indicators */
ind[IN_UNQ] = 1;
ind[IN_HGH] = col_table[b & CHAR] > col_table [a & CHAR];
ind[IN_LOW] = ind[IN_HGH] ^ 1; }
MM (AS); MM (BS); } /* decr pointers */
while ((wm & WM) == 0); /* stop on A, B WM */
if ((a & WM) && !(b & WM)) { /* short A field? */
ind[IN_EQU] = ind[IN_LOW] = 0;
ind[IN_UNQ] = ind[IN_HGH] = 1; }
ind[IN_EQU] = ind[IN_LOW] = 0;
ind[IN_UNQ] = ind[IN_HGH] = 1; }
if (!(cpu_unit.flags & HLE)) /* no HLE? */
ind[IN_EQU] = ind[IN_LOW] = ind[IN_HGH] = 0;
ind[IN_EQU] = ind[IN_LOW] = ind[IN_HGH] = 0;
break;
/* Branch instructions A check B check
@@ -673,23 +684,26 @@ case OP_C: /* compare */
case OP_B: /* branch */
if (ilnt == 4) { BRANCH; } /* uncond branch? */
else if (ilnt == 5) { /* branch on ind? */
if (ind[D]) { BRANCH; } /* test indicator */
if (ind_table[D]) ind[D] = 0; } /* reset if needed */
else { if (ADDR_ERR (BS)) { /* branch char eq */
reason = STOP_INVB; /* validate B addr */
break; }
if ((M[BS] & CHAR) == D) { BRANCH; } /* char equal? */
else { MM (BS); } }
if (ind[D]) { BRANCH; } /* test indicator */
if (ind_table[D]) ind[D] = 0; } /* reset if needed */
else {
if (ADDR_ERR (BS)) { /* branch char eq */
reason = STOP_INVB; /* validate B addr */
break; }
if ((M[BS] & CHAR) == D) { BRANCH; } /* char equal? */
else { MM (BS); } }
break;
case OP_BWZ: /* branch wm or zone */
if (((D & 1) && (M[BS] & WM)) || /* d1? test wm */
((D & 2) && ((M[BS] & ZONE) == (D & ZONE)))) /* d2? test zone */
{ BRANCH; }
else { MM (BS); } /* decr pointer */
else { MM (BS); } /* decr pointer */
break;
case OP_BBE: /* branch if bit eq */
if (M[BS] & D & CHAR) { BRANCH; } /* any bits set? */
else { MM (BS); } /* decr pointer */
else { MM (BS); } /* decr pointer */
break;
/* Arithmetic instructions A check B check
@@ -704,16 +718,19 @@ case OP_BBE: /* branch if bit eq */
case OP_ZA: case OP_ZS: /* zero and add/sub */
a = i = 0; /* clear flags */
do { 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); }
if (i == 0) i = M[BS] = M[BS] |
((((a & ZONE) == BBIT) ^ (op == OP_ZS))? BBIT: ZONE);
MM (BS); }
do {
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); }
if (i == 0) i = M[BS] = M[BS] |
((((a & ZONE) == BBIT) ^ (op == OP_ZS))? BBIT: ZONE);
MM (BS); }
while ((wm & WM) == 0); /* stop on B WM */
break;
case OP_A: case OP_S: /* add/sub */
bsave = BS; /* save sign pos */
a = M[AS]; /* get A digit/sign */
@@ -728,30 +745,32 @@ case OP_A: case OP_S: /* add/sub */
M[BS] = b; /* store result */
MM (BS);
if (b & WM) { /* b wm? done */
if (qsign && (carry == 0)) M[bsave] = /* compl, no carry? */
WM + ((b & ZONE) ^ ABIT) + sum_table[10 - t];
break; }
do { if (a & WM) a = WM; /* A WM? char = 0 */
else { a = M[AS]; /* else get A */
MM (AS); }
b = M[BS]; /* get B */
t = bcd_to_bin[a & DIGIT]; /* get A binary */
t = bcd_to_bin[b & DIGIT] + (qsign? 9 - t: t) + carry;
carry = (t >= 10); /* get carry */
if ((b & WM) && (qsign == 0)) { /* last, no recomp? */
M[BS] = WM + sum_table[t] + /* zone add */
(((a & ZONE) + b + (carry? ABIT: 0)) & ZONE);
ind[IN_OVF] = carry; } /* ovflo if carry */
else M[BS] = (b & WM) + sum_table[t]; /* normal add */
MM (BS); }
if (qsign && (carry == 0)) M[bsave] = /* compl, no carry? */
WM + ((b & ZONE) ^ ABIT) + sum_table[10 - t];
break; }
do {
if (a & WM) a = WM; /* A WM? char = 0 */
else {
a = M[AS]; /* else get A */
MM (AS); }
b = M[BS]; /* get B */
t = bcd_to_bin[a & DIGIT]; /* get A binary */
t = bcd_to_bin[b & DIGIT] + (qsign? 9 - t: t) + carry;
carry = (t >= 10); /* get carry */
if ((b & WM) && (qsign == 0)) { /* last, no recomp? */
M[BS] = WM + sum_table[t] + /* zone add */
(((a & ZONE) + b + (carry? ABIT: 0)) & ZONE);
ind[IN_OVF] = carry; } /* ovflo if carry */
else M[BS] = (b & WM) + sum_table[t]; /* normal add */
MM (BS); }
while ((b & WM) == 0); /* stop on B WM */
if (reason) break; /* address err? */
if (qsign && (carry == 0)) { /* recompl, no carry? */
M[bsave] = M[bsave] ^ ABIT; /* XOR sign */
for (carry = 1; bsave != BS; --bsave) { /* rescan */
t = 9 - bcd_to_bin[M[bsave] & DIGIT] + carry;
carry = (t >= 10);
M[bsave] = (M[bsave] & ~DIGIT) | sum_table[t]; } }
M[bsave] = M[bsave] ^ ABIT; /* XOR sign */
for (carry = 1; bsave != BS; --bsave) { /* rescan */
t = 9 - bcd_to_bin[M[bsave] & DIGIT] + carry;
carry = (t >= 10);
M[bsave] = (M[bsave] & ~DIGIT) | sum_table[t]; } }
break;
/* I/O instructions A check B check
@@ -776,18 +795,21 @@ case OP_R: /* read */
BS = CDR_BUF + CDR_WIDTH;
if (ilnt >= 4) { BRANCH; } /* check for branch */
break;
case OP_W: /* write */
if (reason = iomod (ilnt, D, w_mod)) break; /* valid modifier? */
reason = write_line (ilnt, D); /* print line */
BS = LPT_BUF + LPT_WIDTH;
if (ilnt >= 4) { BRANCH; } /* check for branch */
break;
case OP_P: /* punch */
if (reason = iomod (ilnt, D, NULL)) break; /* valid modifier? */
reason = punch_card (ilnt, D); /* punch card */
BS = CDP_BUF + CDP_WIDTH;
if (ilnt >= 4) { BRANCH; } /* check for branch */
break;
case OP_WR: /* write and read */
if (reason = iomod (ilnt, D, w_mod)) break; /* valid modifier? */
reason = write_line (ilnt, D); /* print line */
@@ -796,6 +818,7 @@ case OP_WR: /* write and read */
if (ilnt >= 4) { BRANCH; } /* check for branch */
if (reason == SCPE_OK) reason = r1; /* merge errors */
break;
case OP_WP: /* write and punch */
if (reason = iomod (ilnt, D, w_mod)) break; /* valid modifier? */
reason = write_line (ilnt, D); /* print line */
@@ -804,6 +827,7 @@ case OP_WP: /* write and punch */
if (ilnt >= 4) { BRANCH; } /* check for branch */
if (reason == SCPE_OK) reason = r1; /* merge errors */
break;
case OP_RP: /* read and punch */
if (reason = iomod (ilnt, D, NULL)) break; /* valid modifier? */
reason = read_card (ilnt, D); /* read card */
@@ -812,6 +836,7 @@ case OP_RP: /* read and punch */
if (ilnt >= 4) { BRANCH; } /* check for branch */
if (reason == SCPE_OK) reason = r1; /* merge errors */
break;
case OP_WRP: /* write, read, punch */
if (reason = iomod (ilnt, D, w_mod)) break; /* valid modifier? */
reason = write_line (ilnt, D); /* print line */
@@ -821,19 +846,23 @@ case OP_WRP: /* write, read, punch */
if (ilnt >= 4) { BRANCH; } /* check for branch */
if (reason == SCPE_OK) reason = (r1 == SCPE_OK)? r2: r1;
break;
case OP_SS: /* select stacker */
if (reason = iomod (ilnt, D, ss_mod)) break; /* valid modifier? */
if (reason = select_stack (D)) break; /* sel stack, error? */
if (ilnt >= 4) { BRANCH; } /* check for branch */
break;
case OP_CC: /* carriage control */
if (reason = carriage_control (D)) break; /* car ctrl, error? */
if (ilnt >= 4) { BRANCH; } /* check for branch */
break;
case OP_MTF: /* magtape function */
if (reason = iomod (ilnt, D, mtf_mod)) break; /* valid modifier? */
if (reason = mt_func (unit, D)) break; /* mt func, error? */
break; /* can't branch */
case OP_RF: case OP_PF: /* read, punch feed */
break; /* nop's */
@@ -864,11 +893,11 @@ case OP_MCE: /* edit */
a = M[AS]; /* get A char */
b = M[BS]; /* get B char */
if (a & WM) { /* one char A field? */
reason = STOP_MCE1;
break; }
reason = STOP_MCE1;
break; }
if (b & WM) { /* one char B field? */
reason = STOP_MCE2;
break; }
reason = STOP_MCE2;
break; }
t = a & DIGIT; MM (AS); /* get A digit */
qsign = ((a & ZONE) == BBIT); /* get A field sign */
qawm = qzero = qbody = 0; /* clear other flags */
@@ -886,78 +915,81 @@ case OP_MCE: /* edit */
& blank B
*/
do { b = M[BS]; /* get B char */
M[BS] = M[BS] & ~WM; /* clr WM */
switch (b & CHAR) { /* case on B char */
case BCD_ASTER: /* * */
if (!qbody || qdollar || !(cpu_unit.flags & EPE)) break;
qaster = 1; /* flag */
goto A_CYCLE; /* take A cycle */
case BCD_DOLLAR: /* $ */
if (!qbody || qaster || !(cpu_unit.flags & EPE)) break;
qdollar = 1; /* flag */
goto A_CYCLE; /* take A cycle */
case BCD_ZERO: /* 0 */
if (qawm && !qzero && !(b & WM)) {
M[BS] = BCD_ZERO + WM; /* mark with WM */
qzero = 1; /* flag supress */
break; }
if (!qzero) t = t | WM; /* first? set WM */
qzero = 1; /* flag supress */
do {
b = M[BS]; /* get B char */
M[BS] = M[BS] & ~WM; /* clr WM */
switch (b & CHAR) { /* case on B char */
case BCD_ASTER: /* * */
if (!qbody || qdollar || !(cpu_unit.flags & EPE)) break;
qaster = 1; /* flag */
goto A_CYCLE; /* take A cycle */
case BCD_DOLLAR: /* $ */
if (!qbody || qaster || !(cpu_unit.flags & EPE)) break;
qdollar = 1; /* flag */
goto A_CYCLE; /* take A cycle */
case BCD_ZERO: /* 0 */
if (qawm && !qzero && !(b & WM)) {
M[BS] = BCD_ZERO + WM; /* mark with WM */
qzero = 1; /* flag supress */
break; }
if (!qzero) t = t | WM; /* first? set WM */
qzero = 1; /* flag supress */
/* fall through */
case BCD_BLANK: /* blank */
if (qawm) break; /* any A left? */
A_CYCLE:
M[BS] = t; /* copy char */
if (a & WM) { /* end of A field? */
qbody = 0; /* end body */
qawm = 1; }
else { qbody = 1; /* in body */
a = M[AS]; MM (AS); /* next A */
t = a & CHAR; }
break;
case BCD_C: case BCD_R: case BCD_MINUS: /* C, R, - */
if (!qsign && !qbody) M[BS] = BCD_BLANK;
break;
case BCD_COMMA: /* , */
if (!qbody) M[BS] = BCD_BLANK; /* bl if status */
break;
case BCD_AMPER: /* & */
M[BS] = BCD_BLANK; /* blank B field */
break; } /* end switch */
MM (BS); } /* decr B pointer */
case BCD_BLANK: /* blank */
if (qawm) break; /* any A left? */
A_CYCLE:
M[BS] = t; /* copy char */
if (a & WM) { /* end of A field? */
qbody = 0; /* end body */
qawm = 1; }
else {
qbody = 1; /* in body */
a = M[AS]; MM (AS); /* next A */
t = a & CHAR; }
break;
case BCD_C: case BCD_R: case BCD_MINUS: /* C, R, - */
if (!qsign && !qbody) M[BS] = BCD_BLANK;
break;
case BCD_COMMA: /* , */
if (!qbody) M[BS] = BCD_BLANK; /* bl if status */
break;
case BCD_AMPER: /* & */
M[BS] = BCD_BLANK; /* blank B field */
break; } /* end switch */
MM (BS); } /* decr B pointer */
while ((b & WM) == 0); /* stop on B WM */
if (reason) break; /* address err? */
if (!qawm || !qzero) { /* rescan? */
if (qdollar) reason = STOP_MCE3; /* error if $ */
break; }
if (qdollar) reason = STOP_MCE3; /* error if $ */
break; }
/* Edit pass 2 - from left to right, supressing zeroes */
do { b = M[++BS]; /* get B char */
switch (b & CHAR) { /* case on B char */
case BCD_ONE: case BCD_TWO: case BCD_THREE:
case BCD_FOUR: case BCD_FIVE: case BCD_SIX:
case BCD_SEVEN: case BCD_EIGHT: case BCD_NINE:
qzero = 0; /* turn off supr */
break;
case BCD_ZERO: case BCD_COMMA: /* 0 or , */
if (qzero && !qdecimal) /* if supr, blank */
M[BS] = qaster? BCD_ASTER: BCD_BLANK;
break;
case BCD_BLANK: /* blank */
if (qaster) M[BS] = BCD_ASTER; /* if EPE *, repl */
break;
case BCD_DECIMAL: /* . */
if (qzero && (cpu_unit.flags & EPE))
qdecimal = 1; /* flag for EPE */
case BCD_PERCNT: case BCD_WM: case BCD_BS:
case BCD_TS: case BCD_MINUS:
break; /* ignore */
default: /* other */
qzero = 1; /* restart supr */
break; } } /* end case, do */
do {
b = M[++BS]; /* get B char */
switch (b & CHAR) { /* case on B char */
case BCD_ONE: case BCD_TWO: case BCD_THREE:
case BCD_FOUR: case BCD_FIVE: case BCD_SIX:
case BCD_SEVEN: case BCD_EIGHT: case BCD_NINE:
qzero = 0; /* turn off supr */
break;
case BCD_ZERO: case BCD_COMMA: /* 0 or , */
if (qzero && !qdecimal) /* if supr, blank */
M[BS] = qaster? BCD_ASTER: BCD_BLANK;
break;
case BCD_BLANK: /* blank */
if (qaster) M[BS] = BCD_ASTER; /* if EPE *, repl */
break;
case BCD_DECIMAL: /* . */
if (qzero && (cpu_unit.flags & EPE))
qdecimal = 1; /* flag for EPE */
case BCD_PERCNT: case BCD_WM: case BCD_BS:
case BCD_TS: case BCD_MINUS:
break; /* ignore */
default: /* other */
qzero = 1; /* restart supr */
break; } } /* end case, do */
while ((b & WM) == 0);
M[BS] = M[BS] & ~WM; /* clear B WM */
@@ -967,16 +999,16 @@ case OP_MCE: /* edit */
/* Edit pass 3 (extended print only) - from right to left */
for (;; ) { /* until chars */
b = M[BS]; /* get B char */
if ((b == BCD_BLANK) && qdollar) { /* blank & flt $? */
M[BS] = BCD_DOLLAR; /* insert $ */
break; } /* exit for */
if (b == BCD_DECIMAL) { /* decimal? */
M[BS] = qaster? BCD_ASTER: BCD_BLANK;
break; } /* exit for */
if ((b == BCD_ZERO) && !qdollar) /* 0 & ~flt $ */
M[BS] = qaster? BCD_ASTER: BCD_BLANK;
BS--; } /* end for */
b = M[BS]; /* get B char */
if ((b == BCD_BLANK) && qdollar) { /* blank & flt $? */
M[BS] = BCD_DOLLAR; /* insert $ */
break; } /* exit for */
if (b == BCD_DECIMAL) { /* decimal? */
M[BS] = qaster? BCD_ASTER: BCD_BLANK;
break; } /* exit for */
if ((b == BCD_ZERO) && !qdollar) /* 0 & ~flt $ */
M[BS] = qaster? BCD_ASTER: BCD_BLANK;
BS--; } /* end for */
break; /* done at last! */
/* Multiply. Comments from the PDP-10 based simulator by Len Fehskens.
@@ -995,9 +1027,10 @@ case OP_MCE: /* edit */
case OP_MUL:
asave = AS; bsave = lowprd = BS; /* save AS, BS */
do { a = M[AS]; /* get mpcd char */
M[BS] = BCD_ZERO; /* zero prod */
MM (AS); MM (BS); } /* decr pointers */
do {
a = M[AS]; /* get mpcd char */
M[BS] = BCD_ZERO; /* zero prod */
MM (AS); MM (BS); } /* decr pointers */
while ((a & WM) == 0); /* until A WM */
if (reason) break; /* address err? */
M[BS] = BCD_ZERO; /* zero hi prod */
@@ -1009,23 +1042,25 @@ case OP_MUL:
AS and ps cannot produce an address error.
*/
do { ps = bsave; /* ptr to prod */
AS = asave; /* ptr to mpcd */
carry = 0; /* init carry */
b = M[BS]; /* get mpyr char */
do { a = M[AS]; /* get mpcd char */
t = (bcd_to_bin[a & DIGIT] * /* mpyr * mpcd */
bcd_to_bin[b & DIGIT]) + /* + c + partial prod */
carry + bcd_to_bin[M[ps] & DIGIT];
carry = cry_table[t];
M[ps] = (M[ps] & WM) | sum_table[t];
MM (AS); ps--; }
while ((a & WM) == 0); /* until mpcd done */
M[BS] = (M[BS] & WM) | BCD_ZERO; /* zero mpyr just used */
t = bcd_to_bin[M[ps] & DIGIT] + carry; /* add carry to prod */
M[ps] = (M[ps] & WM) | sum_table[t]; /* store */
bsave--; /* adv prod ptr */
MM (BS); } /* adv mpyr ptr */
do {
ps = bsave; /* ptr to prod */
AS = asave; /* ptr to mpcd */
carry = 0; /* init carry */
b = M[BS]; /* get mpyr char */
do {
a = M[AS]; /* get mpcd char */
t = (bcd_to_bin[a & DIGIT] * /* mpyr * mpcd */
bcd_to_bin[b & DIGIT]) + /* + c + partial prod */
carry + bcd_to_bin[M[ps] & DIGIT];
carry = cry_table[t];
M[ps] = (M[ps] & WM) | sum_table[t];
MM (AS); ps--; }
while ((a & WM) == 0); /* until mpcd done */
M[BS] = (M[BS] & WM) | BCD_ZERO; /* zero mpyr just used */
t = bcd_to_bin[M[ps] & DIGIT] + carry; /* add carry to prod */
M[ps] = (M[ps] & WM) | sum_table[t]; /* store */
bsave--; /* adv prod ptr */
MM (BS); } /* adv mpyr ptr */
while ((b & WM) == 0); /* until mpyr done */
M[lowprd] = M[lowprd] | ZONE; /* assume + */
if (sign) M[lowprd] = M[lowprd] & ~ABIT; /* if minus, B only */
@@ -1058,24 +1093,26 @@ case OP_MUL:
case OP_DIV:
asave = AS; ahigh = -1;
do { a = M[AS]; /* get dvr char */
if ((a & CHAR) != BCD_ZERO) ahigh = AS; /* mark non-zero */
MM (AS); }
do {
a = M[AS]; /* get dvr char */
if ((a & CHAR) != BCD_ZERO) ahigh = AS; /* mark non-zero */
MM (AS); }
while ((a & WM) == 0);
if (reason) break; /* address err? */
if (ahigh < 0) { /* div? by zero */
ind[IN_OVF] = 1; /* set ovf indic */
qs = bsave = BS; /* quo, dividend */
do { b = M[bsave]; /* find end divd */
PP (bsave); } /* marked by zone */
while ((b & ZONE) == 0);
if (reason) break; /* address err? */
if (ADDR_ERR (qs)) { /* address err? */
reason = STOP_WRAP; /* address wrap? */
break; }
div_sign (M[asave], b, qs - 1, bsave - 1); /* set signs */
BS = (BS - 2) - (asave - (AS + 1)); /* final bs */
break; }
ind[IN_OVF] = 1; /* set ovf indic */
qs = bsave = BS; /* quo, dividend */
do {
b = M[bsave]; /* find end divd */
PP (bsave); } /* marked by zone */
while ((b & ZONE) == 0);
if (reason) break; /* address err? */
if (ADDR_ERR (qs)) { /* address err? */
reason = STOP_WRAP; /* address wrap? */
break; }
div_sign (M[asave], b, qs - 1, bsave - 1); /* set signs */
BS = (BS - 2) - (asave - (AS + 1)); /* final bs */
break; }
bsave = BS + (asave - ahigh); /* end subdivd */
qs = (BS - 2) - (ahigh - (AS + 1)); /* quo start */
@@ -1087,17 +1124,19 @@ case OP_DIV:
qs = current quotient digit
*/
do { quo = 0; /* clear quo digit */
if (ADDR_ERR (qs) || ADDR_ERR (bsave)) {
reason = STOP_WRAP; /* address wrap? */
break; }
b = M[bsave]; /* save low divd */
do { t = div_sub (asave, bsave, ahigh); /* subtract */
quo++; } /* incr quo digit */
while (t == 0); /* until borrow */
div_add (asave, bsave, ahigh); quo--; /* restore */
M[qs] = (M[qs] & WM) | sum_table[quo]; /* store quo digit */
bsave++; qs++; } /* adv divd, quo */
do {
quo = 0; /* clear quo digit */
if (ADDR_ERR (qs) || ADDR_ERR (bsave)) {
reason = STOP_WRAP; /* address wrap? */
break; }
b = M[bsave]; /* save low divd */
do {
t = div_sub (asave, bsave, ahigh); /* subtract */
quo++; } /* incr quo digit */
while (t == 0); /* until borrow */
div_add (asave, bsave, ahigh); quo--; /* restore */
M[qs] = (M[qs] & WM) | sum_table[quo]; /* store quo digit */
bsave++; qs++; } /* adv divd, quo */
while ((b & ZONE) == 0); /* until B sign */
if (reason) break; /* address err? */
@@ -1131,17 +1170,20 @@ case OP_SWM: /* set word mark */
M[AS] = M[AS] | WM; /* set B field mark */
MM (AS); MM (BS); /* decr pointers */
break;
case OP_CWM: /* clear word mark */
M[BS] = M[BS] & ~WM; /* clear A field mark */
M[AS] = M[AS] & ~WM; /* clear B field mark */
MM (AS); MM (BS); /* decr pointers */
break;
case OP_CS: /* clear storage */
t = (BS / 100) * 100; /* lower bound */
while (BS >= t) M[BS--] = 0; /* clear region */
if (BS < 0) BS = BS + MEMSIZE; /* wrap if needed */
if (ilnt >= 7) { BRANCH; } /* branch variant? */
break;
case OP_MA: /* modify address */
a = one_table[M[AS] & CHAR]; MM (AS); /* get A address */
a = a + ten_table[M[AS] & CHAR]; MM (AS);
@@ -1155,18 +1197,22 @@ case OP_MA: /* modify address */
M[BS + 1] = (M[BS + 1] & WM) | store_addr_h (t);
if (((a % 4000) + (b % 4000)) >= 4000) BS = BS + 2; /* carry? */
break;
case OP_SAR: case OP_SBR: /* store A, B reg */
M[AS] = (M[AS] & WM) | store_addr_u (BS); MM (AS);
M[AS] = (M[AS] & WM) | store_addr_t (BS); MM (AS);
M[AS] = (M[AS] & WM) | store_addr_h (BS); MM (AS);
break;
case OP_NOP: /* nop */
break;
case OP_H: /* halt */
if (ilnt >= 4) { BRANCH; } /* branch if called */
reason = STOP_HALT; /* stop simulator */
saved_IS = IS; /* commit instruction */
break;
default:
reason = STOP_NXI; /* unimplemented */
break; } /* end switch */

View File

@@ -203,12 +203,12 @@ if ((fnc == FNC_SEEK) && /* seek and */
if (diff < 0) return STOP_INVDSC; /* error? */
diff = diff >> 1; /* diff is *2 */
if ((M[dcf + DCF_DIR + DCF_DIR_LEN - 1] & ZONE) == BBIT)
diff = -diff; /* get sign */
diff = -diff; /* get sign */
uptr->CYL = uptr->CYL + diff; /* bound seek */
if (uptr->CYL < 0) uptr->CYL = 0;
else if (uptr->CYL >= DP_NUMCY) { /* too big? */
uptr->CYL = 0; /* system hangs */
return STOP_INVDCY; }
uptr->CYL = 0; /* system hangs */
return STOP_INVDCY; }
sim_activate (&dp_unit[0], dp_time); /* set ctlr busy */
return SCPE_OK; } /* done! */
@@ -217,7 +217,7 @@ if ((sec < 0) || (sec >= (DP_NUMDR * DP_TOTSC))) /* bad sector? */
return STOP_INVDSC;
if (fnc == FNC_SEEK) { /* seek? */
uptr->CYL = (sec / (DP_NUMSF * DP_NUMSC)) % /* set cyl # */
DP_NUMCY;
DP_NUMCY;
sim_activate (&dp_unit[0], dp_time); /* set ctlr busy */
return SCPE_OK; } /* done! */
@@ -229,10 +229,11 @@ if (cnt < 0) return STOP_INVDCN; /* bad count? */
if (fnc >= FNC_WOFF) return STOP_INVDFN; /* invalid func */
if (mod == BCD_W) { /* write? */
if (fnc == FNC_CHECK) { /* write check? */
qwc = 1; /* special read */
fnc = dp_lastf; } /* use last func */
else { dp_lastf = fnc; /* save func */
fnc = fnc + FNC_WOFF; } } /* change to write */
qwc = 1; /* special read */
fnc = dp_lastf; } /* use last func */
else {
dp_lastf = fnc; /* save func */
fnc = fnc + FNC_WOFF; } } /* change to write */
else if (mod == BCD_R) dp_lastf = fnc; /* read? save func */
else return STOP_INVM; /* other? error */
@@ -311,8 +312,8 @@ if (r == SCPE_OK) { /* normal so far? */
BS++; /* advance BS */
if (ADDR_ERR (BS)) return STOP_WRAP; /* address error? */
if (M[BS - 1] != (WM + BCD_GRPMRK)) { /* GM + WM at end? */
ind[IN_LNG] = ind[IN_DSK] = 1; /* no, error */
r = STOP_INVDLN; } }
ind[IN_LNG] = ind[IN_DSK] = 1; /* no, error */
r = STOP_INVDLN; } }
CRETIOE (iochk || !ind[IN_DSK], r); /* return status */
}
@@ -330,18 +331,18 @@ static const int32 dec_tab[DP_ADDR] = /* powers of 10 */
for (i = 0; i < DP_ADDR; i++) { /* copy address */
if (M[BS] == (WM | BCD_GRPMRK)) { /* premature GWM? */
ind[IN_LNG] = ind[IN_DSK] = 1; /* error */
return STOP_INVDLN; }
ind[IN_LNG] = ind[IN_DSK] = 1; /* error */
return STOP_INVDLN; }
if (zad) { /* addr zero? */
ac = sec / dec_tab[i]; /* get addr digit */
sec = sec % dec_tab[i]; /* get remainder */
ac = bcd_to_bin[ac]; } /* cvt to BCD */
ac = sec / dec_tab[i]; /* get addr digit */
sec = sec % dec_tab[i]; /* get remainder */
ac = bcd_to_bin[ac]; } /* cvt to BCD */
else ac = *ap; /* addr char */
if (qwc) { /* wr chk? skip if zad */
if (!zad && (flg? (M[BS] != ac): /* L? cmp with WM */
((M[BS] & CHAR) != (ac & CHAR)))) { /* M? cmp w/o WM */
ind[IN_DPW] = ind[IN_DSK] = 1;
return STOP_WRCHKE; } }
if (!zad && (flg? (M[BS] != ac): /* L? cmp with WM */
((M[BS] & CHAR) != (ac & CHAR)))) { /* M? cmp w/o WM */
ind[IN_DPW] = ind[IN_DSK] = 1;
return STOP_WRCHKE; } }
else if (flg) M[BS] = ac & CHAR; /* load mode */
else M[BS] = (M[BS] & WM) | (ac & CHAR); /* move mode */
ap++; BS++; /* adv ptrs */
@@ -360,13 +361,13 @@ uint8 *ap = ((uint8 *) uptr->filebuf) + da + DP_ADDR; /* buf ptr */
lim = flg? (DP_DATA - 10): DP_DATA; /* load vs move */
for (i = 0; i < lim; i++) { /* copy data */
if (M[BS] == (WM | BCD_GRPMRK)) { /* premature GWM? */
ind[IN_LNG] = ind[IN_DSK] = 1; /* error */
return STOP_INVDLN; }
ind[IN_LNG] = ind[IN_DSK] = 1; /* error */
return STOP_INVDLN; }
if (qwc) { /* write check? */
if (flg? (M[BS] != *ap): /* load mode cmp */
((M[BS] & CHAR) != (*ap & CHAR))) { /* move mode cmp */
ind[IN_DPW] = ind[IN_DSK] = 1; /* error */
return STOP_WRCHKE; } }
if (flg? (M[BS] != *ap): /* load mode cmp */
((M[BS] & CHAR) != (*ap & CHAR))) { /* move mode cmp */
ind[IN_DPW] = ind[IN_DSK] = 1; /* error */
return STOP_WRCHKE; } }
else if (flg) M[BS] = *ap & (WM | CHAR); /* load mode */
else M[BS] = (M[BS] & WM) | (*ap & CHAR); /* word mode */
ap++; BS++; /* adv ptrs */
@@ -384,9 +385,9 @@ uint8 *ap = ((uint8 *) uptr->filebuf) + da; /* buf ptr */
for (i = 0; i < DP_ADDR; i++) { /* copy address */
if (M[BS] == (WM | BCD_GRPMRK)) { /* premature GWM? */
dp_fill (uptr, da, DP_NUMCH - i); /* fill, set err */
ind[IN_LNG] = ind[IN_DSK] = 1; /* error */
return STOP_INVDLN; }
dp_fill (uptr, da, DP_NUMCH - i); /* fill, set err */
ind[IN_LNG] = ind[IN_DSK] = 1; /* error */
return STOP_INVDLN; }
if (flg) *ap = M[BS] & (WM | CHAR); /* L? copy WM */
else *ap = M[BS] & CHAR; /* M? strip WM */
if (da >= uptr->hwmark) uptr->hwmark = da + 1;
@@ -406,9 +407,9 @@ uint8 *ap = ((uint8 *) uptr->filebuf) + da; /* buf ptr */
lim = flg? (DP_DATA - 10): DP_DATA; /* load vs move */
for (i = 0; i < lim; i++) { /* copy data */
if (M[BS] == (WM | BCD_GRPMRK)) { /* premature GWM? */
dp_fill (uptr, da, DP_DATA - i); /* fill, set err */
ind[IN_LNG] = ind[IN_DSK] = 1; /* error */
return STOP_INVDLN; }
dp_fill (uptr, da, DP_DATA - i); /* fill, set err */
ind[IN_LNG] = ind[IN_DSK] = 1; /* error */
return STOP_INVDLN; }
if (flg) *ap = M[BS] & (WM | CHAR); /* load, copy WM */
else *ap = M[BS] & CHAR; /* move, strip WM */
if (da >= uptr->hwmark) uptr->hwmark = da + 1;
@@ -475,7 +476,7 @@ uint8 c;
for (i = 0; i < DP_ADDR; i++, ap++) { /* loop thru addr */
c = M[dcf + DCF_SEC + i]; /* sector addr char */
if ((c & CHAR) != (*ap & CHAR)) /* cmp w/o WM */
return FALSE; }
return FALSE; }
return TRUE; /* compare ok */
}

View File

@@ -25,6 +25,7 @@
inq 1407 inquiry terminal
22-Dec-02 RMS Added break support
07-Sep-01 RMS Moved function prototypes
14-Apr-99 RMS Changed t_addr to unsigned
*/
@@ -82,39 +83,41 @@ case BCD_R: /* input */
ind[IN_INR] = 0; /* clear req */
puts_tty ("[Enter]\r\n"); /* prompt */
for (i = 0; M[BS] != (BCD_GRPMRK + WM); i++) { /* until GM + WM */
while ((t = sim_poll_kbd ()) == SCPE_OK)
if (stop_cpu) return SCPE_STOP; /* interrupt? */
if (t < SCPE_KFLAG) return t; /* if not char, err */
t = t & 0177;
if ((t == '\r') || (t == '\n')) break;
if (t == inq_char) { /* cancel? */
ind[IN_INC] = 1; /* set indicator */
puts_tty ("\r\n[Canceled]\r\n");
return SCPE_OK; }
if (i && ((i % INQ_WIDTH) == 0)) puts_tty ("\r\n");
sim_putchar (t); /* echo */
if (flag == MD_WM) { /* word mark mode? */
if ((t == '~') && (wm_seen == 0)) wm_seen = WM;
else { M[BS] = wm_seen | ascii_to_bcd[t];
wm_seen = 0; } }
else M[BS] = (M[BS] & WM) | ascii_to_bcd[t];
if (!wm_seen) BS++;
if (ADDR_ERR (BS)) {
BS = BA | (BS % MAXMEMSIZE);
return STOP_NXM; } }
while (((t = sim_poll_kbd ()) == SCPE_OK) ||
(t & SCPE_BREAK)) {
if (stop_cpu) return SCPE_STOP; } /* interrupt? */
if (t < SCPE_KFLAG) return t; /* if not char, err */
t = t & 0177;
if ((t == '\r') || (t == '\n')) break;
if (t == inq_char) { /* cancel? */
ind[IN_INC] = 1; /* set indicator */
puts_tty ("\r\n[Canceled]\r\n");
return SCPE_OK; }
if (i && ((i % INQ_WIDTH) == 0)) puts_tty ("\r\n");
sim_putchar (t); /* echo */
if (flag == MD_WM) { /* word mark mode? */
if ((t == '~') && (wm_seen == 0)) wm_seen = WM;
else {
M[BS] = wm_seen | ascii_to_bcd[t];
wm_seen = 0; } }
else M[BS] = (M[BS] & WM) | ascii_to_bcd[t];
if (!wm_seen) BS++;
if (ADDR_ERR (BS)) {
BS = BA | (BS % MAXMEMSIZE);
return STOP_NXM; } }
puts_tty ("\r\n");
M[BS++] = BCD_GRPMRK + WM;
return SCPE_OK;
case BCD_W: /* output */
for (i = 0; (t = M[BS++]) != (BCD_GRPMRK + WM); i++) {
if ((flag == MD_WM) && (t & WM)) {
if (i && ((i % INQ_WIDTH) == 0)) puts_tty ("\r\n");
sim_putchar ('~'); }
if ((flag == MD_WM) && (t & WM)) {
if (i && ((i % INQ_WIDTH) == 0)) puts_tty ("\r\n");
sim_putchar (bcd_to_ascii[t & CHAR]);
if (ADDR_ERR (BS)) {
BS = BA | (BS % MAXMEMSIZE);
return STOP_NXM; } }
sim_putchar ('~'); }
if (i && ((i % INQ_WIDTH) == 0)) puts_tty ("\r\n");
sim_putchar (bcd_to_ascii[t & CHAR]);
if (ADDR_ERR (BS)) {
BS = BA | (BS % MAXMEMSIZE);
return STOP_NXM; } }
puts_tty ("\r\n");
return SCPE_OK;
default:

View File

@@ -164,14 +164,14 @@ switch (action) {
case 0: /* to channel now */
if ((mod == 0) || (mod > 12) || CHP (mod, cct[cctptr])) return SCPE_OK;
for (i = 1; i < cctlnt + 1; i++) { /* sweep thru cct */
if (CHP (mod, cct[(cctptr + i) % cctlnt]))
return space (i, TRUE); }
if (CHP (mod, cct[(cctptr + i) % cctlnt]))
return space (i, TRUE); }
return STOP_CCT; /* runaway channel */
case 1: /* space after */
if (mod <= 3) {
lines = mod; /* save # lines */
lflag = FALSE; /* flag spacing */
ind[IN_CC9] = ind[IN_CC12] = 0; }
lines = mod; /* save # lines */
lflag = FALSE; /* flag spacing */
ind[IN_CC9] = ind[IN_CC12] = 0; }
return SCPE_OK;
case 2: /* space now */
if (mod <= 3) return space (mod, FALSE);
@@ -180,10 +180,10 @@ case 3: /* to channel after */
if ((mod == 0) || (mod > 12)) return SCPE_OK; /* check channel */
ind[IN_CC9] = ind[IN_CC12] = 0;
for (i = 1; i < cctlnt + 1; i++) { /* sweep thru cct */
if (CHP (mod, cct[(cctptr + i) % cctlnt])) {
lines = i; /* save # lines */
lflag = TRUE; /* flag skipping */
return SCPE_OK; } }
if (CHP (mod, cct[(cctptr + i) % cctlnt])) {
lines = i; /* save # lines */
lflag = TRUE; /* flag skipping */
return SCPE_OK; } }
return STOP_CCT; } /* runaway channel */
return SCPE_OK;
}
@@ -203,7 +203,8 @@ if ((lpt_unit.flags & UNIT_ATT) == 0) return SCPE_UNATT;
cctptr = (cctptr + count) % cctlnt; /* adv cct, mod lnt */
if (sflag && CHP (0, cct[cctptr])) /* skip, top of form? */
fputs ("\n\f", lpt_unit.fileref); /* nl, ff */
else { for (i = 0; i < count; i++) fputc ('\n', lpt_unit.fileref); }
else { for (i = 0; i < count; i++)
fputc ('\n', lpt_unit.fileref); }
lpt_unit.pos = ftell (lpt_unit.fileref); /* update position */
ind[IN_CC9] = CHP (9, cct[cctptr]) != 0; /* set indicators */
ind[IN_CC12] = CHP (12, cct[cctptr]) != 0;

View File

@@ -147,16 +147,15 @@ switch (mod) { /* case on modifier */
case BCD_B: /* backspace */
ind[IN_END] = 0; /* clear end of reel */
if (pnu || (uptr->pos < sizeof (t_mtrlnt))) /* bot or pnu? */
return SCPE_OK;
fseek (uptr->fileref, uptr->pos - sizeof (t_mtrlnt),
SEEK_SET);
return SCPE_OK;
fseek (uptr->fileref, uptr->pos - sizeof (t_mtrlnt), SEEK_SET);
fxread (&tbc, sizeof (t_mtrlnt), 1, uptr->fileref);
if ((err = ferror (uptr->fileref)) || /* err or eof? */
feof (uptr->fileref)) break;
if ((tbc == MTR_TMK) || (tbc == MTR_EOM)) /* tmk or eom? */
uptr->pos = uptr->pos - sizeof (t_mtrlnt);
uptr->pos = uptr->pos - sizeof (t_mtrlnt);
else uptr->pos = uptr->pos - ((MTRL (tbc) + 1) & ~1) -
(2 * sizeof (t_mtrlnt));
(2 * sizeof (t_mtrlnt));
break; /* end case */
case BCD_E: /* erase = nop */
@@ -218,13 +217,13 @@ case BCD_R: /* read */
fxread (&tbc, sizeof (t_mtrlnt), 1, uptr->fileref);
if (err = ferror (uptr->fileref)) break; /* error? */
if (feof (uptr->fileref) || (tbc == MTR_EOM)) { /* eom or eof? */
ind[IN_TAP] = 1; /* pretend error */
MT_SET_PNU (uptr); /* pos not upd */
break; }
ind[IN_TAP] = 1; /* pretend error */
MT_SET_PNU (uptr); /* pos not upd */
break; }
if (tbc == MTR_TMK) { /* tape mark? */
ind[IN_END] = 1; /* set end mark */
uptr->pos = uptr->pos + sizeof (t_mtrlnt);
break; }
ind[IN_END] = 1; /* set end mark */
uptr->pos = uptr->pos + sizeof (t_mtrlnt);
break; }
if (MTRF (tbc)) ind[IN_TAP] = 1; /* error? set flag */
tbc = MTRL (tbc); /* clear error flag */
if (tbc > MT_MAXFR) return SCPE_MTRLNT; /* record too long? */
@@ -232,31 +231,32 @@ case BCD_R: /* read */
if (err = ferror (uptr->fileref)) break; /* I/O error? */
for ( ; i < tbc; i++) dbuf[i] = 0; /* fill with 0's */
uptr->pos = uptr->pos + ((tbc + 1) & ~1) +
(2 * sizeof (t_mtrlnt));
(2 * sizeof (t_mtrlnt));
for (i = 0; i < tbc; i++) { /* loop thru buf */
if (M[BS] == (BCD_GRPMRK + WM)) { /* GWM in memory? */
BS++; /* incr BS */
if (ADDR_ERR (BS)) { /* test for wrap */
BS = BA | (BS % MAXMEMSIZE);
return STOP_WRAP; }
return SCPE_OK; } /* done */
t = dbuf[i]; /* get char */
if ((flag != MD_BIN) && (t == BCD_ALT)) t = BCD_BLANK;
if (flag == MD_WM) { /* word mk mode? */
if ((t == BCD_WM) && (wm_seen == 0)) wm_seen = WM;
else { M[BS] = wm_seen | (t & CHAR);
wm_seen = 0; } }
else M[BS] = (M[BS] & WM) | (t & CHAR);
if (!wm_seen) BS++;
if (ADDR_ERR (BS)) { /* check next BS */
BS = BA | (BS % MAXMEMSIZE);
return STOP_WRAP; } }
if (M[BS] == (BCD_GRPMRK + WM)) { /* GWM in memory? */
BS++; /* incr BS */
if (ADDR_ERR (BS)) { /* test for wrap */
BS = BA | (BS % MAXMEMSIZE);
return STOP_WRAP; }
return SCPE_OK; } /* done */
t = dbuf[i]; /* get char */
if ((flag != MD_BIN) && (t == BCD_ALT)) t = BCD_BLANK;
if (flag == MD_WM) { /* word mk mode? */
if ((t == BCD_WM) && (wm_seen == 0)) wm_seen = WM;
else {
M[BS] = wm_seen | (t & CHAR);
wm_seen = 0; } }
else M[BS] = (M[BS] & WM) | (t & CHAR);
if (!wm_seen) BS++;
if (ADDR_ERR (BS)) { /* check next BS */
BS = BA | (BS % MAXMEMSIZE);
return STOP_WRAP; } }
if (flag == MD_WM) M[BS] = WM | BCD_GRPMRK; /* load? set WM */
else M[BS] = (M[BS] & WM) | BCD_GRPMRK; /* move? save WM */
BS++; /* adv BS */
if (ADDR_ERR (BS)) { /* check final BS */
BS = BA | (BS % MAXMEMSIZE);
return STOP_WRAP; }
BS = BA | (BS % MAXMEMSIZE);
return STOP_WRAP; }
break;
case BCD_W:
@@ -264,13 +264,13 @@ case BCD_W:
if (M[BS] == (BCD_GRPMRK + WM)) return STOP_MTZ; /* eor? */
ind[IN_TAP] = ind[IN_END] = 0; /* clear error */
for (tbc = 0; (t = M[BS++]) != (BCD_GRPMRK + WM); ) {
if ((t & WM) && (flag == MD_WM)) dbuf[tbc++] = BCD_WM;
if (((t & CHAR) == BCD_BLANK) && (flag != MD_BIN))
dbuf[tbc++] = BCD_ALT;
else dbuf[tbc++] = t & CHAR;
if (ADDR_ERR (BS)) { /* check next BS */
BS = BA | (BS % MAXMEMSIZE);
return STOP_WRAP; } }
if ((t & WM) && (flag == MD_WM)) dbuf[tbc++] = BCD_WM;
if (((t & CHAR) == BCD_BLANK) && (flag != MD_BIN))
dbuf[tbc++] = BCD_ALT;
else dbuf[tbc++] = t & CHAR;
if (ADDR_ERR (BS)) { /* check next BS */
BS = BA | (BS % MAXMEMSIZE);
return STOP_WRAP; } }
ebc = (tbc + 1) & ~1; /* force even */
fseek (uptr->fileref, uptr->pos, SEEK_SET);
fxwrite (&tbc, sizeof (t_mtrlnt), 1, uptr->fileref);
@@ -279,8 +279,8 @@ case BCD_W:
if (err = ferror (uptr->fileref)) break; /* I/O error? */
uptr->pos = uptr->pos + ebc + (2 * sizeof (t_mtrlnt));
if (ADDR_ERR (BS)) { /* check final BS */
BS = BA | (BS % MAXMEMSIZE);
return STOP_WRAP; }
BS = BA | (BS % MAXMEMSIZE);
return STOP_WRAP; }
break;
default:
return STOP_INVM; }

View File

@@ -133,18 +133,18 @@ ptr = 0;
for ( ; (cptr = fgets (cbuf, CBUFSIZE, fileref)) != NULL; ) { /* until eof */
mask = 0;
if (*cptr == '(') { /* repeat count? */
cptr = get_glyph (cptr + 1, gbuf, ')'); /* get 1st field */
rpt = get_uint (gbuf, 10, CCT_LNT, &r); /* repeat count */
if (r != SCPE_OK) return SCPE_FMT; }
cptr = get_glyph (cptr + 1, gbuf, ')'); /* get 1st field */
rpt = get_uint (gbuf, 10, CCT_LNT, &r); /* repeat count */
if (r != SCPE_OK) return SCPE_FMT; }
else rpt = 1;
while (*cptr != 0) { /* get col no's */
cptr = get_glyph (cptr, gbuf, ','); /* get next field */
col = get_uint (gbuf, 10, 12, &r); /* column number */
if (r != SCPE_OK) return SCPE_FMT;
mask = mask | (1 << col); } /* set bit */
cptr = get_glyph (cptr, gbuf, ','); /* get next field */
col = get_uint (gbuf, 10, 12, &r); /* column number */
if (r != SCPE_OK) return SCPE_FMT;
mask = mask | (1 << col); } /* set bit */
for ( ; rpt > 0; rpt--) { /* store vals */
if (ptr >= CCT_LNT) return SCPE_FMT;
cctbuf[ptr++] = mask; } }
if (ptr >= CCT_LNT) return SCPE_FMT;
cctbuf[ptr++] = mask; } }
if (ptr == 0) return SCPE_FMT;
cctlnt = ptr;
cctptr = 0;
@@ -203,7 +203,7 @@ extern int32 op_table[64], len_table[9];
if (sw & SWMASK ('C')) { /* character? */
t = val[0];
if (uptr->flags & UNIT_BCD)
fprintf (of, (t & WM)? "~%c": "%c", bcd_to_ascii[t & CHAR]);
fprintf (of, (t & WM)? "~%c": "%c", bcd_to_ascii[t & CHAR]);
else fprintf (of, FMTASC (t & 0177));
return SCPE_OK; }
if ((uptr != NULL) && (uptr != &cpu_unit)) return SCPE_ARG; /* CPU? */
@@ -214,8 +214,9 @@ if (sw & SWMASK ('D')) { /* dump? */
return -(i - 1); }
if (sw & SWMASK ('S')) { /* string? */
i = 0;
do { t = val[i++];
fprintf (of, (t & WM)? "~%c": "%c", bcd_to_ascii[t & CHAR]); }
do {
t = val[i++];
fprintf (of, (t & WM)? "~%c": "%c", bcd_to_ascii[t & CHAR]); }
while ((i < LINE_LNT) && ((val[i] & WM) == 0));
return -(i - 1); }
if ((sw & SWMASK ('M')) == 0) return SCPE_ARG;
@@ -300,13 +301,13 @@ if ((sw & SWMASK ('C')) || (sw & SWMASK ('S')) || (*cptr == '~') ||
((*cptr == '\'') && cptr++) || ((*cptr == '"') && cptr++)) {
wm_seen = 0;
for (i = 0; (i < sim_emax) && (*cptr != 0); ) {
t = *cptr++; /* get character */
if (cflag && (wm_seen == 0) && (t == '~')) wm_seen = WM;
else if (uptr->flags & UNIT_BCD) {
if (t < 040) return SCPE_ARG;
val[i++] = ascii_to_bcd[t] | wm_seen;
wm_seen = 0; }
else val[i++] = t; }
t = *cptr++; /* get character */
if (cflag && (wm_seen == 0) && (t == '~')) wm_seen = WM;
else if (uptr->flags & UNIT_BCD) {
if (t < 040) return SCPE_ARG;
val[i++] = ascii_to_bcd[t] | wm_seen;
wm_seen = 0; }
else val[i++] = t; }
if ((i == 0) || wm_seen) return SCPE_ARG;
return -(i-1); }
@@ -321,14 +322,14 @@ if (((op_table[op] && IO) && (get_io (gbuf, &val[1]) == SCPE_OK)) ||
(get_addr (gbuf, &val[1]) == SCPE_OK)) {
cptr = get_glyph (cptr, gbuf, 0); /* get addr or d */
if (get_addr (gbuf, &val[4]) == SCPE_OK) {
cptr = get_glyph (cptr, gbuf, ','); /* get d */
ilnt = 7; } /* a and b addresses */
cptr = get_glyph (cptr, gbuf, ','); /* get d */
ilnt = 7; } /* a and b addresses */
else ilnt = 4; } /* a address */
else ilnt = 1; /* no addresses */
if ((gbuf[0] == '\'') || (gbuf[0] == '"')) { /* d character? */
t = gbuf[1];
if ((gbuf[2] != 0) || (*cptr != 0) || (t < 040))
return SCPE_ARG; /* end and legal? */
return SCPE_ARG; /* end and legal? */
val[ilnt] = ascii_to_bcd[t]; /* save D char */
ilnt = ilnt + 1; }
else if (gbuf[0] != 0) return SCPE_ARG; /* not done? */