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

Notes For V3.6-0

The save/restore format has been updated to improve its reliability.
As a result, save files prior to release 3.0 are no longer supported.

The text documentation files are obsolete and are no longer included
with the distribution.  Up-to-date PDF documentation files are
available on the SimH web site.

1. New Features

1.1 3.6-0

1.1.1 Most magnetic tapes

- Added support for limiting tape capacity to a particular size in MB

1.1.2 IBM 7090/7094

- First release

1.1.3 VAX-11/780

- Added FLOAD command, loads system file from console floppy disk

1.1.4 VAX, VAX-11/780, and PDP-11

- Added card reader support (from John Dundas)

1.1.5 PDP-11

- Added instruction history

1.2 3.6-1

1.2.1 PDP-11

- Added RF11 support
- Added multiple KL11/DL11 support
- Added upper-case only mode to TTI, TTO

1.2.2

- Added binary loader (courtesy of Dave Pitt)

2. Bugs Fixed

Please see the revision history on http://simh.trailing-edge.com or
in the source module sim_rev.h.
This commit is contained in:
Bob Supnik
2006-07-20 13:36:00 -07:00
committed by Mark Pizzolato
parent dc871fa631
commit 15919a2dd7
44 changed files with 2249 additions and 376 deletions

View File

@@ -1,6 +1,6 @@
/* pdp18b_cpu.c: 18b PDP CPU simulator
Copyright (c) 1993-2005, Robert M Supnik
Copyright (c) 1993-2006, 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"),
@@ -25,6 +25,7 @@
cpu PDP-4/7/9/15 central processor
27-Jun-06 RMS Reset clears AC, L, and MQ
22-Sep-05 RMS Fixed declarations (from Sterling Garwood)
16-Aug-05 RMS Fixed C++ declaration and cast problems
22-Jul-05 RMS Removed AAS, error in V1 reference manual
@@ -1889,6 +1890,8 @@ return pa;
t_stat cpu_reset (DEVICE *dptr)
{
LAC = 0;
MQ = 0;
SC = 0;
eae_ac_sign = 0;
ion = ion_defer = ion_inh = 0;

View File

@@ -1,3 +1,55 @@
18b PDP Diagnostics
1. PDP-4
2. PDP-7
2.1 PDP-7 Instruction Test (Maindec 701)
The diagnostic must be boot loaded, as it jumps dynamically out
of the RIM load process into its own loader.
At start, set SR<1:16> to a non-zero value. The diagnostic
executes four HLT's as part of initial tests and then runs to
completion. Normal HLT is at 2623 (PC = 2624).
sim> att -e ptr digital-7-54-m-rim.bin
sim> boot ptr
HALT instruction, PC: 17670 (AND 17727)
sim> d sr 4 ; any even value between 2 and 377776
sim> run 170
HALT instruction, PC: 00171 (CML CMA)
sim> ex ac,l
AC: 000000
L: 0
sim> c
HALT instruction, PC: 00173 (SPA)
sim> ex ac,l
AC: 777777
L: 1
sim> c
HALT instruction, PC: 00176 (SPA)
sim> ex ac,l
AC: 000000
L: 0
sim> c
HALT instruction, PC: 00201 (LAC 4116)
sim> ex ac,l
AC: 000004
L: 0
sim> c
HALT instruction, PC: 02624 (JMP 201)
3. PDP-9
4. PDP-15
Operating Instructions, PDP-15 diagnostics
MAINDEC-15-D0A1-PH Instruction test 1
@@ -14,7 +66,7 @@ Breakpoint: 4437 for one pass
MAINDEC-15-D0AA-PB Index register test
Read in: 17700 (binary tape, doesn't matter)
Read in: 17700 (ignored, binary tape)
Start: 200
Halts: at 214, set BANKM = 0
Runs to: prints END at end of pass

View File

@@ -1,6 +1,6 @@
/* pdp18b_dt.c: 18b DECtape simulator
Copyright (c) 1993-2005, Robert M Supnik
Copyright (c) 1993-2006, 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"),
@@ -27,6 +27,9 @@
(PDP-9) TC02/TU55 DECtape
(PDP-15) TC15/TU56 DECtape
23-Jun-06 RMS Fixed switch conflict in ATTACH
Revised Type 550 header based on DECTOG formatter
13-Jun-06 RMS Fixed checksum calculation bug in Type 550
16-Aug-05 RMS Fixed C++ declaration and cast problems
25-Jan-04 RMS Revised for device debug support
14-Jan-04 RMS Revised IO device call interface
@@ -65,22 +68,23 @@
DECtape motion is measured in 3b lines. Time between lines is 33.33us.
Tape density is nominally 300 lines per inch. The format of a DECtape (as
taken from the TD8E formatter) is:
taken from the PDP-7 formatter) is:
reverse end zone 8192 reverse end zone codes ~ 10 feet
reverse end zone 7144 reverse end zone codes ~ 12 feet
reverse buffer 200 interblock codes
block 0
:
block n
forward buffer 200 interblock codes
forward end zone 8192 forward end zone codes ~ 10 feet
forward end zone 7144 forward end zone codes ~ 12 feet
A block consists of five 18b header words, a tape-specific number of data
words, and five 18b trailer words. All systems except the PDP-8 use a
standard block length of 256 words; the PDP-8 uses a standard block length
of 86 words (x 18b = 129 words x 12b). [A PDP-4/7 DECtape has only four 18b
header words; for consistency, the PDP-4/7 uses the same format as the PDP-9/15
but skips the missing header words.]
of 86 words (x 18b = 129 words x 12b). PDP-4/7 DECtapes came in two
formats. The first 5 controllers used a 4 word header/trailer (missing
word 0/4). All later serial numbers used the standard header. The later,
standard header/trailer is simulated here.
Because a DECtape file only contains data, the simulator cannot support
write timing and mark track and can only do a limited implementation
@@ -848,9 +852,7 @@ int32 mot = DTS_GETMOT (uptr->STATE);
int32 dir = mot & DTS_DIR;
int32 fnc = DTS_GETFNC (uptr->STATE);
int32 *fbuf = (int32 *) uptr->filebuf;
#if defined (TC02)
int32 unum = uptr - dt_dev.units;
#endif
int32 blk, wrd, ma, relpos;
uint32 ba;
@@ -925,6 +927,8 @@ switch (fnc) { /* at speed, check fnc *
if (MEM_ADDR_OK (ma)) M[ma] = blk; /* store block # */
if (((dtsa & DTA_MODE) == 0) || (M[DT_WC] == 0))
dtsb = dtsb | DTB_DTF; /* set DTF */
if (DEBUG_PRI (dt_dev, LOG_MS))
fprintf (sim_deb, ">>DT%d: found block %d\n", unum, blk);
break;
/* Read has four subcases
@@ -1128,6 +1132,8 @@ switch (fnc) { /* at speed, check fnc *
sim_activate (uptr, DTU_LPERB (uptr) * dt_ltime);/* sched next block */
dtdb = blk; /* store block # */
dtsb = dtsb | DTB_DTF; /* set DTF */
if (DEBUG_PRI (dt_dev, LOG_MS))
fprintf (sim_deb, ">>DT%d: search found block %d\n", unum, blk);
break;
/* Read and read all */
@@ -1149,8 +1155,10 @@ switch (fnc) { /* at speed, check fnc *
else {
ma = (2 * DT_HTWRD) + DTU_BSIZE (uptr) - DT_CSMWD - 1;
wrd = relpos / DT_WSIZE; /* hdr start = wd 0 */
#if defined (OLD_TYPE550)
if ((wrd == 0) || /* skip 1st, last */
(wrd == ((2 * DT_HTWRD) + DTU_BSIZE (uptr) - 1))) break;
#endif
if ((fnc == FNC_READ) && /* read, skip if not */
(wrd != DT_CSMWD) && /* fwd, rev cksum */
(wrd != ma)) break;
@@ -1184,8 +1192,10 @@ switch (fnc) { /* at speed, check fnc *
}
else {
wrd = relpos / DT_WSIZE; /* hdr start = wd 0 */
#if defined (OLD_TYPE550)
if ((wrd == 0) || /* skip 1st, last */
(wrd == ((2 * DT_HTWRD) + DTU_BSIZE (uptr) - 1))) break;
#endif
if ((fnc == FNC_WRIT) && /* wr, skip if !csm */
(wrd != ((2 * DT_HTWRD) + DTU_BSIZE (uptr) - DT_CSMWD - 1)))
break;
@@ -1279,14 +1289,15 @@ int32 dt_gethdr (UNIT *uptr, int32 blk, int32 relpos)
int32 wrd = relpos / DT_WSIZE;
if (wrd == DT_BLKWD) return blk; /* fwd blknum */
if (wrd == DT_CSMWD) return 077; /* rev csum */
#if defined (TC02) /* TC02/TC15 */
if (wrd == DT_CSMWD) return 077; /* rev csum */
if (wrd == ((2 * DT_HTWRD) + DTU_BSIZE (uptr) - DT_CSMWD - 1)) /* fwd csum */
return (dt_csum (uptr, blk) << 12);
#else
#else /* Type 550 */
if (wrd == DT_CSMWD) return 0777777; /* rev csum */
if (wrd == ((2 * DT_HTWRD) + DTU_BSIZE (uptr) - DT_CSMWD - 1)) /* fwd csum */
return (dt_csum (uptr, blk));
#endif /* Type 550 */
#endif
if (wrd == ((2 * DT_HTWRD) + DTU_BSIZE (uptr) - DT_BLKWD - 1)) /* rev blkno */
return dt_comobv (blk);
return 0; /* all others */
@@ -1353,11 +1364,11 @@ r = attach_unit (uptr, cptr); /* attach */
if (r != SCPE_OK) return r; /* error? */
if ((sim_switches & SIM_SW_REST) == 0) { /* not from rest? */
uptr->flags = uptr->flags & ~(UNIT_8FMT | UNIT_11FMT); /* default 18b */
if (sim_switches & SWMASK ('R')) /* att 12b? */
if (sim_switches & SWMASK ('T')) /* att 12b? */
uptr->flags = uptr->flags | UNIT_8FMT;
else if (sim_switches & SWMASK ('S')) /* att 16b? */
uptr->flags = uptr->flags | UNIT_11FMT;
else if (!(sim_switches & SWMASK ('T')) && /* autosize? */
else if (!(sim_switches & SWMASK ('A')) && /* autosize? */
(sz = sim_fsize (uptr->fileref))) {
if (sz == D8_FILSIZ)
uptr->flags = uptr->flags | UNIT_8FMT;

View File

@@ -1,6 +1,6 @@
/* pdp18b_fpp.c: FP15 floating point processor simulator
Copyright (c) 2003-2005, Robert M Supnik
Copyright (c) 2003-2006, 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"),
@@ -25,6 +25,7 @@
fpp PDP-15 floating point processor
06-Jul-06 RMS Fixed bugs in left shift, multiply
31-Oct-04 RMS Fixed URFST to mask low 9b of fraction
Fixed exception PC setting
10-Apr-04 RMS JEA is 15b not 18b
@@ -663,7 +664,8 @@ if (dp_cmp (a,b) >= 0) { /* |a| >= |b|? */
a->hi = (a->hi - b->hi - (a->lo < b->lo)) & UFP_FH_MASK;
a->lo = (a->lo - b->lo) & UFP_FL_MASK; /* a - b */
}
else { a->hi = (b->hi - a->hi - (b->lo < a->lo)) & UFP_FH_MASK;
else {
a->hi = (b->hi - a->hi - (b->lo < a->lo)) & UFP_FH_MASK;
a->lo = (b->lo - a->lo) & UFP_FL_MASK; /* b - a */
a->sign = a->sign ^ 1; /* change a sign */
}
@@ -681,7 +683,7 @@ if (a->lo > b->lo) return +1;
return 0;
}
/* Double precision multiply - returns 70b result */
/* Double precision multiply - returns 70b result in a'fmq */
void dp_mul (UFP *a, UFP *b)
{
@@ -690,7 +692,11 @@ int32 i;
fmq.hi = a->hi; /* FMQ <- a */
fmq.lo = a->lo;
a->hi = a->lo = 0; /* a <- 0 */
if (((fmq.hi | fmq.lo) == 0) || ((b->hi | b->lo) == 0)) return;
if ((fmq.hi | fmq.lo) == 0) return;
if ((b->hi | b->lo) == 0) {
fmq.hi = fmq.lo = 0;
return;
}
for (i = 0; i < 35; i++) { /* 35 iterations */
if (fmq.lo & 1) dp_add (a, b); /* FMQ<35>? a += b */
dp_rsh_1 (a, &fmq); /* rsh a'FMQ */
@@ -702,12 +708,12 @@ return;
void dp_lsh_1 (UFP *a, UFP *b)
{
int32 t = b? b->lo: 0;
int32 t = b? b->hi: 0;
a->hi = (a->hi << 1) | (a->lo >> 17);
a->lo = ((a->lo << 1) | (t >> 16)) & UFP_FL_MASK;
a->hi = (a->hi << 1) | ((a->lo >> 17) & 1);
a->lo = ((a->lo << 1) | ((t >> 16) & 1)) & UFP_FL_MASK;
if (b) {
b->hi = ((b->hi << 1) | (b->lo >> 17)) & UFP_FH_MASK;
b->hi = ((b->hi << 1) | ((b->lo >> 17) & 1)) & UFP_FH_MASK;
b->lo = (b->lo << 1) & UFP_FL_MASK;
}
return;
@@ -761,18 +767,23 @@ void fp15_asign (int32 fir, UFP *a)
int32 sgnop = FI_GETSGNOP (fir);
switch (sgnop) { /* modify FMA sign */
case 1:
a->sign = 0;
break;
case 2:
a->sign = 1;
break;
case 3:
a->sign = a->sign ^ 1;
break;
default:
break;
}
return;
}
@@ -809,8 +820,8 @@ if (rnd && b && (b->hi & UFP_FH_NORM)) { /* rounding? */
}
}
}
if (a->exp > 0377777) return FP_OVF; /* overflow? */
if (a->exp < -0400000) return FP_UNF; /* underflow? */
if (a->exp > (int32) 0377777) return FP_OVF; /* overflow? */
if (a->exp < (int32) -0400000) return FP_UNF; /* underflow? */
return FP_OK;
}

View File

@@ -1,6 +1,6 @@
/* pdp18b_lp.c: 18b PDP's line printer simulator
Copyright (c) 1993-2005, Robert M Supnik
Copyright (c) 1993-2006, 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"),
@@ -28,6 +28,7 @@
lp09 (PDP-9,15) LP09 line printer
lp15 (PDP-15) LP15 line printer
11-Jun-06 RMS Made character translation table global scope
14-Jan-04 RMS Revised IO device call interface
23-Jul-03 RMS Fixed overprint bug in Type 62
25-Apr-03 RMS Revised for extended file support
@@ -46,6 +47,12 @@
#include "pdp18b_defs.h"
extern int32 int_hwre[API_HLVL+1];
const char fio_to_asc[64] = {
' ','1','2','3','4','5','6','7','8','9','\'','~','#','V','^','<',
'0','/','S','T','U','V','W','X','Y','Z','"',',','>','^','-','?',
'o','J','K','L','M','N','O','P','Q','R','$','=','-',')','-','(',
'_','A','B','C','D','E','F','G','H','I','*','.','+',']','|','['
};
#if defined (TYPE62)
@@ -60,12 +67,6 @@ int32 lp62_ovrpr = 0; /* overprint */
int32 lp62_stopioe = 0;
int32 lp62_bp = 0; /* buffer ptr */
char lp62_buf[LP62_BSIZE + 1] = { 0 };
static const char lp62_trans[64] = {
' ','1','2','3','4','5','6','7','8','9','\'','~','#','V','^','<',
'0','/','S','T','U','V','W','X','Y','Z','"',',','>','^','-','?',
'o','J','K','L','M','N','O','P','Q','R','$','=','-',')','-','(',
'_','A','B','C','D','E','F','G','H','I','*','.','+',']','|','['
};
static const char *lp62_cc[] = {
"\n",
"\n\n",
@@ -138,9 +139,9 @@ if (pulse & 02) {
if (sb == 000) CLR_INT (LPT); /* LPCF */
if ((sb == 040) && (lp62_bp < BPTR_MAX)) { /* LPLD */
i = lp62_bp * 3; /* cvt to chr ptr */
lp62_buf[i] = lp62_trans[(dat >> 12) & 077];
lp62_buf[i + 1] = lp62_trans[(dat >> 6) & 077];
lp62_buf[i + 2] = lp62_trans[dat & 077];
lp62_buf[i] = fio_to_asc[(dat >> 12) & 077];
lp62_buf[i + 1] = fio_to_asc[(dat >> 6) & 077];
lp62_buf[i + 2] = fio_to_asc[dat & 077];
lp62_bp = (lp62_bp + 1) & BPTR_MASK;
}
}

View File

@@ -1,6 +1,6 @@
/* pdp18b_stddev.c: 18b PDP's standard devices
Copyright (c) 1993-2005, Robert M Supnik
Copyright (c) 1993-2006, 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"),
@@ -29,6 +29,10 @@
tto teleprinter
clk clock
30-Jun-06 RMS Fixed KSR-28 shift tracking
20-Jun-06 RMS Added KSR ASCII reader support
13-Jun-06 RMS Fixed Baudot letters/figures inversion for PDP-4
Fixed PDP-4/PDP-7 default terminal to be local echo
22-Nov-05 RMS Revised for new terminal processing routines
28-May-04 RMS Removed SET TTI CTRL-C
16-Feb-04 RMS Fixed bug in hardware read-in mode bootstrap
@@ -66,6 +70,8 @@
#define UNIT_V_RASCII (UNIT_V_UF + 0) /* reader ASCII */
#define UNIT_RASCII (1 << UNIT_V_RASCII)
#define UNIT_V_KASCII (UNIT_V_UF + 1) /* KSR ASCII */
#define UNIT_KASCII (1 << UNIT_V_KASCII)
#define UNIT_V_PASCII (UNIT_V_UF + 0) /* punch ASCII */
#define UNIT_PASCII (1 << UNIT_V_PASCII)
@@ -78,11 +84,41 @@ extern UNIT cpu_unit;
int32 clk_state = 0;
int32 ptr_err = 0, ptr_stopioe = 0, ptr_state = 0;
int32 ptp_err = 0, ptp_stopioe = 0;
int32 tti_state = 0;
int32 tto_state = 0;
int32 tti_2nd = 0; /* 2nd char waiting */
int32 tty_shift = 0; /* KSR28 shift state */
int32 clk_tps = 60; /* ticks/second */
int32 tmxr_poll = 16000; /* term mux poll */
const int32 asc_to_baud[128] = {
000,000,000,000,000,000,000,064, /* bell */
000,000,0110,000,000,0102,000,000, /* lf, cr */
000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,
0104,066,061,045,062,000,053,072, /* space - ' */
076,051,000,000,046,070,047,067, /* ( - / */
055,075,071,060,052,041,065,074, /* 0 - 7 */
054,043,056,057,000,000,000,063, /* 8 - ? */
000,030,023,016,022,020,026,013, /* @ - G */
005,014,032,036,011,007,006,003, /* H - O */
015,035,012,024,001,034,017,031, /* P - W */
027,025,021,000,000,000,000,000, /* X - _ */
000,030,023,016,022,020,026,013, /* ` - g */
005,014,032,036,011,007,006,003, /* h - o */
015,035,012,024,001,034,017,031, /* p - w */
027,025,021,000,000,000,000,000 /* x - DEL */
};
const char baud_to_asc[64] = {
0 ,'T',015,'O',' ','H','N','M',
012,'L','R','G','I','P','C','V',
'E','Z','D','B','S','Y','F','X',
'A','W','J', 0 ,'U','Q','K', 0,
0 ,'5','\r','9',' ','#',',','.',
012,')','4','&','8','0',':',';',
'3','"','$','?','\a','6','!','/',
'-','2','\'',0 ,'7','1','(', 0
};
int32 ptr (int32 dev, int32 pulse, int32 dat);
int32 ptp (int32 dev, int32 pulse, int32 dat);
int32 tti (int32 dev, int32 pulse, int32 dat);
@@ -181,6 +217,8 @@ REG ptr_reg[] = {
};
MTAB ptr_mod[] = {
{ UNIT_RASCII, UNIT_RASCII, "even parity ASCII", NULL },
{ UNIT_KASCII, UNIT_KASCII, "forced parity ASCII", NULL },
{ MTAB_XTD|MTAB_VDV, 0, "DEVNO", NULL, NULL, &show_devno },
{ 0 }
};
@@ -220,6 +258,7 @@ REG ptp_reg[] = {
};
MTAB ptp_mod[] = {
{ UNIT_PASCII, UNIT_PASCII, "7b ASCII", NULL },
{ MTAB_XTD|MTAB_VDV, 0, "DEVNO", NULL, NULL, &show_devno },
{ 0 }
};
@@ -237,59 +276,35 @@ DEVICE ptp_dev = {
tti_dev TTI device descriptor
tti_unit TTI unit
tti_reg TTI register list
tti_trans ASCII to Baudot table
*/
#if defined (KSR28)
#define TTI_WIDTH 5
#define TTI_FIGURES (1 << TTI_WIDTH)
#define TTI_2ND (1 << (TTI_WIDTH + 1))
#define TTI_BOTH (1 << (TTI_WIDTH + 2))
#define BAUDOT_LETTERS 033
#define BAUDOT_FIGURES 037
#define TTI_BOTH (1 << (TTI_WIDTH + 1))
#define BAUDOT_LETTERS 037
#define BAUDOT_FIGURES 033
static const int32 tti_trans[128] = {
000,000,000,000,000,000,000,064, /* bell */
000,000,0210,000,000,0202,000,000, /* lf, cr */
000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,
0204,066,061,045,062,000,053,072, /* space - ' */
076,051,000,000,046,070,047,067, /* ( - / */
055,075,071,060,052,041,065,074, /* 0 - 7 */
054,043,056,057,000,000,000,063, /* 8 - ? */
000,030,023,016,022,020,026,013, /* @ - G */
005,014,032,036,011,007,006,003, /* H - O */
015,035,012,024,001,034,017,031, /* P - W */
027,025,021,000,000,000,000,000, /* X - _ */
000,030,023,016,022,020,026,013, /* ` - g */
005,014,032,036,011,007,006,003, /* h - o */
015,035,012,024,001,034,017,031, /* p - w */
027,025,021,000,000,000,000,000 /* x - DEL */
};
#else
#define TTI_WIDTH 8
#endif
#define TTI_MASK ((1 << TTI_WIDTH) - 1)
#define UNIT_V_HDX (TTUF_V_UF + 0) /* half duplex */
#define UNIT_HDX (1 << UNIT_V_HDX)
#define TTUF_V_HDX (TTUF_V_UF + 0) /* half duplex */
#define TTUF_HDX (1 << TTUF_V_HDX)
DIB tti_dib = { DEV_TTI, 1, &tti_iors, { &tti } };
#if defined (PDP4) || defined (PDP7)
UNIT tti_unit = { UDATA (&tti_svc, TT_MODE_KSR, 0), KBD_POLL_WAIT };
#else
UNIT tti_unit = { UDATA (&tti_svc, TT_MODE_KSR+UNIT_HDX, 0), KBD_POLL_WAIT };
#endif
UNIT tti_unit = { UDATA (&tti_svc, TT_MODE_KSR+TTUF_HDX, 0), KBD_POLL_WAIT };
REG tti_reg[] = {
{ ORDATA (BUF, tti_unit.buf, TTI_WIDTH) },
#if defined (KSR28)
{ ORDATA (BUF2ND, tti_2nd, TTI_WIDTH), REG_HRO },
#endif
{ FLDATA (INT, int_hwre[API_TTI], INT_V_TTI) },
{ FLDATA (DONE, int_hwre[API_TTI], INT_V_TTI) },
#if defined (KSR28)
{ ORDATA (TTI_STATE, tti_state, (TTI_WIDTH + 3)), REG_HRO },
#endif
{ DRDATA (POS, tti_unit.pos, T_ADDR_W), PV_LEFT },
{ DRDATA (TIME, tti_unit.wait, 24), REG_NZ + PV_LEFT },
{ NULL }
@@ -301,9 +316,9 @@ MTAB tti_mod[] = {
{ TT_MODE, TT_MODE_7B, "7b", "7B", &tty_set_mode },
{ TT_MODE, TT_MODE_8B, "8b", "8B", &tty_set_mode },
{ TT_MODE, TT_MODE_7P, "7b", NULL, NULL },
{ UNIT_HDX, 0 , "full duplex", "FDX", NULL },
{ UNIT_HDX, UNIT_HDX, "half duplex", "HDX", NULL },
#endif
{ TTUF_HDX, 0 , "full duplex", "FDX", NULL },
{ TTUF_HDX, TTUF_HDX, "half duplex", "HDX", NULL },
{ MTAB_XTD|MTAB_VDV, 0, "DEVNO", NULL, NULL, &show_devno, NULL },
{ 0 }
};
@@ -321,23 +336,12 @@ DEVICE tti_dev = {
tto_dev TTO device descriptor
tto_unit TTO unit
tto_reg TTO register list
tto_trans Baudot to ASCII table
*/
#if defined (KSR28)
#define TTO_WIDTH 5
#define TTO_FIGURES (1 << TTO_WIDTH)
static const char tto_trans[64] = {
0 ,'T',015,'O',' ','H','N','M',
012,'L','R','G','I','P','C','V',
'E','Z','D','B','S','Y','F','X',
'A','W','J', 0 ,'U','Q','K', 0,
0 ,'5','\r','9',' ','#',',','.',
012,')','4','&','8','0',':',';',
'3','"','$','?','\a','6','!','/',
'-','2','\'',0 ,'7','1','(', 0
};
#else
#define TTO_WIDTH 8
@@ -351,11 +355,11 @@ UNIT tto_unit = { UDATA (&tto_svc, TT_MODE_KSR, 0), 1000 };
REG tto_reg[] = {
{ ORDATA (BUF, tto_unit.buf, TTO_WIDTH) },
#if defined (KSR28)
{ FLDATA (SHIFT, tty_shift, 0), REG_HRO },
#endif
{ FLDATA (INT, int_hwre[API_TTO], INT_V_TTO) },
{ FLDATA (DONE, int_hwre[API_TTO], INT_V_TTO) },
#if defined (KSR28)
{ FLDATA (TTO_STATE, tto_state, 0), REG_HRO },
#endif
{ DRDATA (POS, tto_unit.pos, T_ADDR_W), PV_LEFT },
{ DRDATA (TIME, tto_unit.wait, 24), PV_LEFT },
{ NULL }
@@ -507,6 +511,8 @@ if (ptr_state == 0) { /* ASCII */
ptr_unit.buf = ptr_unit.buf ^ 0200; /* count bits */
ptr_unit.buf = ptr_unit.buf ^ 0200; /* set even parity */
}
else if (ptr_unit.flags & UNIT_KASCII) /* KSR ASCII? */
ptr_unit.buf = (temp | 0200) & 0377; /* forced parity */
else ptr_unit.buf = temp & 0377;
}
else if (temp & 0200) { /* binary */
@@ -550,9 +556,11 @@ t_stat reason;
reason = attach_unit (uptr, cptr);
ptr_err = (ptr_unit.flags & UNIT_ATT)? 0: 1;
ptr_unit.flags = ptr_unit.flags & ~UNIT_RASCII;
ptr_unit.flags = ptr_unit.flags & ~(UNIT_RASCII|UNIT_KASCII);
if (sim_switches & SWMASK ('A'))
ptr_unit.flags = ptr_unit.flags | UNIT_RASCII;
if (sim_switches & SWMASK ('K'))
ptr_unit.flags = ptr_unit.flags | UNIT_KASCII;
return reason;
}
@@ -889,23 +897,34 @@ return dat;
t_stat tti_svc (UNIT *uptr)
{
#if defined (KSR28) /* Baudot... */
int32 c;
int32 in, c;
sim_activate (uptr, uptr->wait); /* continue poll */
if (tti_state & TTI_2ND) { /* char waiting? */
uptr->buf = tti_state & TTI_MASK; /* return char */
tti_state = tti_state & ~TTI_2ND; /* not waiting */
if (tti_2nd) { /* char waiting? */
uptr->buf = tti_2nd; /* return char */
tti_2nd = 0; /* not waiting */
}
else {
if ((c = sim_poll_kbd ()) < SCPE_KFLAG) return c;
c = tti_trans[c & 0177]; /* translate char */
if ((in = sim_poll_kbd ()) < SCPE_KFLAG) return in;
c = asc_to_baud[in & 0177]; /* translate char */
if (c == 0) return SCPE_OK; /* untranslatable? */
if (((c & TTI_FIGURES) == (tti_state & TTI_FIGURES)) ||
(c & TTI_BOTH)) uptr->buf = c & TTI_MASK;
else {
uptr->buf = (c & TTI_FIGURES)?
BAUDOT_FIGURES: BAUDOT_LETTERS;
tti_state = c | TTI_2ND; /* set 2nd waiting */
if ((c & TTI_BOTH) || /* case insensitive? */
(((c & TTI_FIGURES)? 1: 0) == tty_shift)) /* right case? */
uptr->buf = c & TTI_MASK;
else { /* send case change */
if (c & TTI_FIGURES) { /* to figures? */
uptr->buf = BAUDOT_FIGURES;
tty_shift = 1;
}
else { /* no, to letters */
uptr->buf = BAUDOT_LETTERS;
tty_shift = 0;
}
tti_2nd = c & TTI_MASK; /* save actual char */
}
if (uptr->flags & TTUF_HDX) { /* half duplex? */
sim_putchar (sim_tt_outcvt (in, TTUF_MODE_UC));
tto_unit.pos = tto_unit.pos + 1;
}
}
@@ -917,7 +936,7 @@ if ((c = sim_poll_kbd ()) < SCPE_KFLAG) return c; /* no char or error? */
out = c & 0177; /* mask echo to 7b */
if (c & SCPE_BREAK) c = 0; /* break? */
else c = sim_tt_inpcvt (c, TT_GET_MODE (uptr->flags) | TTUF_KSR);
if ((uptr->flags & UNIT_HDX) && out && /* half duplex and */
if ((uptr->flags & TTUF_HDX) && out && /* half duplex and */
((out = sim_tt_outcvt (out, TT_GET_MODE (uptr->flags))) >= 0)) {
sim_putchar (out); /* echo */
tto_unit.pos = tto_unit.pos + 1;
@@ -942,7 +961,8 @@ return (TST_INT (TTI)? IOS_TTI: 0);
t_stat tti_reset (DEVICE *dptr)
{
tti_unit.buf = 0; /* clear buffer */
tti_state = 0; /* clear state */
tti_2nd = 0;
tty_shift = 0; /* clear state */
CLR_INT (TTI); /* clear flag */
sim_activate (&tti_unit, tti_unit.wait); /* activate unit */
return SCPE_OK;
@@ -972,11 +992,11 @@ t_stat r;
#if defined (KSR28) /* Baudot... */
if (uptr->buf == BAUDOT_FIGURES) /* set figures? */
tto_state = TTO_FIGURES;
tty_shift = 1;
else if (uptr->buf == BAUDOT_LETTERS) /* set letters? */
tto_state = 0;
tty_shift = 0;
else {
c = tto_trans[uptr->buf + tto_state]; /* translate */
c = baud_to_asc[uptr->buf | (tty_shift << 5)]; /* translate */
#else
c = sim_tt_outcvt (uptr->buf, TT_GET_MODE (uptr->flags));
@@ -1006,7 +1026,7 @@ return (TST_INT (TTO)? IOS_TTO: 0);
t_stat tto_reset (DEVICE *dptr)
{
tto_unit.buf = 0; /* clear buffer */
tto_state = 0; /* clear state */
tty_shift = 0; /* clear state */
CLR_INT (TTO); /* clear flag */
sim_cancel (&tto_unit); /* deactivate unit */
return SCPE_OK;

View File

@@ -1,6 +1,6 @@
/* pdp18b_sys.c: 18b PDP's simulator interface
Copyright (c) 1993-2005, Robert M Supnik
Copyright (c) 1993-2006, 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"),
@@ -23,6 +23,8 @@
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from Robert M Supnik.
12-Jun-06 RMS Added Fiodec, Baudot display
RMS Generalized LOAD to handle HRI, RIM, or BIN files
22-Jul-05 RMS Removed AAS, error in V1 reference manual
09-Jan-04 RMS Fixed instruction table errors
18-Oct-03 RMS Added DECtape off reel message
@@ -96,6 +98,9 @@ extern REG cpu_reg[];
extern int32 M[];
extern int32 memm;
extern int32 PC;
extern const char asc_to_baud[128];
extern const char baud_to_asc[64];
extern const char fio_to_asc[64];
/* SCP data structures and interface routines
@@ -231,7 +236,7 @@ for (;;) {
return SCPE_OK; /* done */
}
/* PDP-9/15 RIM format loader
/* PDP-7/9/15 hardware read-in format loader
Tape format (read in address specified externally)
data
@@ -240,7 +245,7 @@ return SCPE_OK; /* done */
word to execute (bit 1 of last character set)
*/
t_stat rim_load_915 (FILE *fileref, char *cptr)
t_stat hri_load_7915 (FILE *fileref, char *cptr)
{
int32 bits, origin, val;
char gbuf[CBUFSIZE];
@@ -312,35 +317,30 @@ for (;;) { /* block loop */
return SCPE_OK;
}
#if defined (PDP4) || defined (PDP7)
/* PDP-4/PDP-7: RIM format only */
t_stat sim_load (FILE *fileref, char *cptr, char *fnam, int flag)
{
if (flag != 0) return SCPE_NOFNC;
return rim_load_47 (fileref, cptr);
}
#else
/* PDP-9/PDP-15: all formats */
/* Binary loader, all formats */
t_stat sim_load (FILE *fileref, char *cptr, char *fnam, int flag)
{
extern int32 sim_switches;
if (flag != 0) return SCPE_NOFNC;
if (sim_switches & SWMASK ('S')) /* PDP-4/7 format? */
if (sim_switches & SWMASK ('S')) /* RIM format? */
return rim_load_47 (fileref, cptr);
if ((sim_switches & SWMASK ('R')) || /* RIM format? */
(match_ext (fnam, "RIM") && !(sim_switches & SWMASK ('B'))))
return rim_load_915 (fileref, cptr);
if (sim_switches & SWMASK ('R')) /* HRI format? */
return hri_load_7915 (fileref, cptr);
if (!(sim_switches & SWMASK ('B')) && /* .rim extension? */
match_ext (fnam, "RIM")) {
int32 val, bits;
do { /* look for HRI flag */
val = getword (fileref, &bits);
} while ((val >= 0) && ((bits & 1) == 0));
rewind (fileref); /* rewind file */
if (val < 0) return rim_load_47 (fileref, cptr); /* eof reached? */
return hri_load_7915 (fileref, cptr); /* no, HRI */
}
return bin_load_915 (fileref, cptr); /* must be BIN */
}
#endif
/* Symbol tables */
#define I_V_FL 18 /* inst class */
@@ -869,6 +869,12 @@ for (i = 0; opc_val[i] >= 0; i++) { /* loop thru ops */
return sp;
}
static int32 rar (int32 c)
{
c = c & 077;
return (c >> 1) | (c << 5);
}
/* Symbolic decode
Inputs:
@@ -881,7 +887,7 @@ return sp;
return = status code
*/
#define FMTASC(x) (((x) < 040)? "<%03o>": "%c"), (x)
#define FMTASC(x) (((x) < 040)? "<%03o>": "%c"), (x)
#define SIXTOASC(x) (((x) >= 040)? (x): ((x) + 0100))
t_stat fprint_sym (FILE *of, t_addr addr, t_value *val,
@@ -902,6 +908,20 @@ if (sw & SWMASK ('C')) { /* character? */
fprintf (of, "%c", SIXTOASC (inst & 077));
return SCPE_OK;
}
#if defined (PDP4) || defined (PDP7)
if (sw & SWMASK ('F')) { /* FIODEC? */
fprintf (of, "%c", fio_to_asc[(inst >> 12) & 077]);
fprintf (of, "%c", fio_to_asc[(inst >> 6) & 077]);
fprintf (of, "%c", fio_to_asc[inst & 077]);
return SCPE_OK;
}
if (sw & SWMASK ('B')) { /* Baudot? */
fprintf (of, "%c", baud_to_asc[rar (inst >> 12) & 077]);
fprintf (of, "%c", baud_to_asc[rar (inst >> 6) & 077]);
fprintf (of, "%c", baud_to_asc[rar (inst) & 077]);
return SCPE_OK;
}
#endif
#if defined (PDP15)
if (sw & SWMASK ('P')) { /* packed ASCII? */
i = val[1];