1
0
mirror of https://github.com/simh/simh.git synced 2026-01-25 19:56:25 +00:00

Bob Supnik's state as of 10/12/2013

This commit is contained in:
Mark Pizzolato
2013-10-12 13:23:44 -07:00
parent 6031deddf8
commit 34ce1a038c
71 changed files with 5708 additions and 377 deletions

View File

@@ -1,6 +1,6 @@
/* pdp8_cpu.c: PDP-8 CPU simulator
Copyright (c) 1993-2011, Robert M Supnik
Copyright (c) 1993-2013, 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 central processor
17-Sep-13 RMS Fixed boot in wrong field problem (Dave Gesswein)
28-Apr-07 RMS Removed clock initialization
30-Oct-06 RMS Added idle and infinite loop detection
30-Sep-06 RMS Fixed SC value after DVI overflow (Don North)
@@ -330,7 +331,8 @@ t_stat reason;
/* Restore register state */
if (build_dev_tab ()) return SCPE_STOP; /* build dev_tab */
if (build_dev_tab ()) /* build dev_tab */
return SCPE_STOP;
PC = saved_PC & 007777; /* load local copies */
IF = saved_PC & 070000;
DF = saved_DF & 070000;
@@ -1373,6 +1375,15 @@ sim_brk_types = sim_brk_dflt = SWMASK ('E');
return SCPE_OK;
}
/* Set PC for boot (PC<14:12> will typically be 0) */
void cpu_set_bootpc (int32 pc)
{
saved_PC = pc; /* set PC, IF */
saved_DF = IB = pc & 070000; /* set IB, DF */
return;
}
/* Memory examine */
t_stat cpu_ex (t_value *vptr, t_addr addr, UNIT *uptr, int32 sw)

View File

@@ -1,6 +1,6 @@
/* pdp8_ct.c: PDP-8 cassette tape simulator
Copyright (c) 2006-2011, Robert M Supnik
Copyright (c) 2006-2013, 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,9 +25,10 @@
ct TA8E/TU60 cassette tape
17-Sep-07 RMS Changed to use central set_bootpc routine
13-Aug-07 RMS Fixed handling of BEOT
06-Aug-07 RMS Foward op at BOT skips initial file gap
30-May-2007 RMS Fixed typo (Norm Lastovica)
30-May007 RMS Fixed typo (Norm Lastovica)
Magnetic tapes are represented as a series of variable records
of the form:
@@ -719,13 +720,12 @@ static const uint16 boot_rom[] = {
t_stat ct_boot (int32 unitno, DEVICE *dptr)
{
int32 i;
extern int32 saved_PC;
extern uint16 M[];
if ((ct_dib.dev != DEV_CT) || unitno) /* only std devno */
return STOP_NOTSTD;
for (i = 0; i < BOOT_LEN; i++)
M[BOOT_START + i] = boot_rom[i];
saved_PC = BOOT_START;
cpu_set_bootpc (BOOT_START);
return SCPE_OK;
}

View File

@@ -1,6 +1,6 @@
/* pdp8_defs.h: PDP-8 simulator definitions
Copyright (c) 1993-2012, Robert M Supnik
Copyright (c) 1993-2013, 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,8 +23,9 @@
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from Robert M Supnik.
18-Sep-13 RMS Added set_bootpc prototype
18-Apr-12 RMS Removed separate timer for additional terminals;
added clock_cosched prototype
Added clock_cosched prototype
22-May-10 RMS Added check for 64b definitions
21-Aug-07 RMS Added FPP8 support
13-Dec-06 RMS Added TA8E support
@@ -211,5 +212,6 @@ t_stat set_dev (UNIT *uptr, int32 val, char *cptr, void *desc);
t_stat show_dev (FILE *st, UNIT *uptr, int32 val, void *desc);
int32 clk_cosched (int32 wait);
void cpu_set_bootpc (int32 pc);
#endif

View File

@@ -1,6 +1,6 @@
/* pdp8_df.c: DF32 fixed head disk simulator
Copyright (c) 1993-2011, Robert M Supnik
Copyright (c) 1993-2013, 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,8 @@
df DF32 fixed head disk
17-Sep-13 RMS Changed to use central set_bootpc routine
03-Sep-13 RMS Added explicit void * cast
15-May-06 RMS Fixed bug in autosize attach (Dave Gesswein)
07-Jan-06 RMS Fixed unaligned register access bug (Doug Carman)
04-Jan-04 RMS Changed sim_fsize calling sequence
@@ -249,7 +251,7 @@ t_stat df_svc (UNIT *uptr)
{
int32 pa, t, mex;
uint32 da;
int16 *fbuf = uptr->filebuf;
int16 *fbuf = (int16 *) uptr->filebuf;
UPDATE_PCELL; /* update photocell */
if ((uptr->flags & UNIT_BUF) == 0) { /* not buf? abort */
@@ -340,12 +342,12 @@ extern int32 sim_switches, saved_PC;
if (sim_switches & SWMASK ('D')) {
for (i = 0; i < DM4_LEN; i = i + 2)
M[dm4_rom[i]] = dm4_rom[i + 1];
saved_PC = DM4_START;
cpu_set_bootpc (DM4_START);
}
else {
for (i = 0; i < OS8_LEN; i++)
M[OS8_START + i] = os8_rom[i];
saved_PC = OS8_START;
cpu_set_bootpc (OS8_START);
}
return SCPE_OK;
}

View File

@@ -1,6 +1,6 @@
/* pdp8_dt.c: PDP-8 DECtape simulator
Copyright (c) 1993-2011, Robert M Supnik
Copyright (c) 1993-2013, 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 @@
dt TC08/TU56 DECtape
17-Sep-13 RMS Changed to use central set_bootpc routine
23-Jun-06 RMS Fixed switch conflict in ATTACH
07-Jan-06 RMS Fixed unaligned register access bug (Doug Carman)
16-Aug-05 RMS Fixed C++ declaration and cast problems
@@ -383,7 +384,8 @@ int32 pulse = IR & 07;
int32 old_dtsa = dtsa, fnc;
UNIT *uptr;
if (pulse & 01) AC = AC | dtsa; /* DTRA */
if (pulse & 01) /* DTRA */
AC = AC | dtsa;
if (pulse & 06) { /* select */
if (pulse & 02) /* DTCA */
dtsa = 0;
@@ -1014,7 +1016,8 @@ return SCPE_OK;
int32 dt_gethdr (UNIT *uptr, int32 blk, int32 relpos, int32 dir)
{
if (relpos >= DT_HTLIN) relpos = relpos - (DT_WSIZE * DTU_BSIZE (uptr));
if (relpos >= DT_HTLIN)
relpos = relpos - (DT_WSIZE * DTU_BSIZE (uptr));
if (dir) { /* reverse */
switch (relpos / DT_WSIZE) {
case 6: /* rev csm */
@@ -1188,7 +1191,7 @@ if (dt_dib.dev != DEV_DTA) /* only std devno */
dt_unit[unitno].pos = DT_EZLIN;
for (i = 0; i < BOOT_LEN; i++)
M[BOOT_START + i] = boot_rom[i];
saved_PC = BOOT_START;
cpu_set_bootpc (BOOT_START);
return SCPE_OK;
}

View File

@@ -1,6 +1,6 @@
/* pdp8_pt.c: PDP-8 paper tape reader/punch simulator
Copyright (c) 1993-2011, Robert M Supnik
Copyright (c) 1993-2013, 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 @@
ptr,ptp PC8E paper tape reader/punch
17-Mar-13 RMS Modified to use central set_bootpc routine
25-Apr-03 RMS Revised for extended file support
04-Oct-02 RMS Added DIBs
30-May-02 RMS Widened POS to 32b
@@ -286,6 +287,6 @@ if (ptr_dib.dev != DEV_PTR) /* only std devno */
return STOP_NOTSTD;
for (i = 0; i < BOOT_LEN; i++)
M[BOOT_START + i] = boot_rom[i];
saved_PC = BOOT_START;
cpu_set_bootpc (BOOT_START);
return SCPE_OK;
}

View File

@@ -1,6 +1,6 @@
/* pdp8_rf.c: RF08 fixed head disk simulator
Copyright (c) 1993-2011, Robert M Supnik
Copyright (c) 1993-2013, 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,8 @@
rf RF08 fixed head disk
17-Sep-13 RMS Changed to use central set_bootpc routine
03-Sep-13 RMS Added explicit void * cast
15-May-06 RMS Fixed bug in autosize attach (Dave Gesswein)
07-Jan-06 RMS Fixed unaligned register access bug (Doug Carman)
04-Jan-04 RMS Changed sim_fsize calling sequence
@@ -302,7 +304,7 @@ return AC;
t_stat rf_svc (UNIT *uptr)
{
int32 pa, t, mex;
int16 *fbuf = uptr->filebuf;
int16 *fbuf = (int16 *) uptr->filebuf;
UPDATE_PCELL; /* update photocell */
if ((uptr->flags & UNIT_BUF) == 0) { /* not buf? abort */
@@ -406,12 +408,12 @@ if (rf_dib.dev != DEV_RF) /* only std devno */
if (sim_switches & SWMASK ('D')) {
for (i = 0; i < DM4_LEN; i = i + 2)
M[dm4_rom[i]] = dm4_rom[i + 1];
saved_PC = DM4_START;
cpu_set_bootpc (DM4_START);
}
else {
for (i = 0; i < OS8_LEN; i++)
M[OS8_START + i] = os8_rom[i];
saved_PC = OS8_START;
cpu_set_bootpc (OS8_START);
}
return SCPE_OK;
}

View File

@@ -1,6 +1,6 @@
/* pdp8_rk.c: RK8E cartridge disk simulator
Copyright (c) 1993-2011, Robert M Supnik
Copyright (c) 1993-2013, 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,8 @@
rk RK8E/RK05 cartridge disk
17-Sep-13 RMS Changed to use central set_bootpc routine
18-Mar-13 RMS Raised RK_MIN so that RKLFMT will work (Mark Pizzolato)
25-Apr-03 RMS Revised for extended file support
04-Oct-02 RMS Added DIB, device number support
06-Jan-02 RMS Changed enable/disable support
@@ -121,7 +123,7 @@
((rk_cmd & RKC_IE) != 0)) \
int_req = int_req | INT_RK; \
else int_req = int_req & ~INT_RK
#define RK_MIN 10
#define RK_MIN 50
#define MAX(x,y) (((x) > (y))? (x): (y))
extern uint16 M[];
@@ -458,6 +460,6 @@ if (rk_dib.dev != DEV_RK) /* only std devno */
for (i = 0; i < BOOT_LEN; i++)
M[BOOT_START + i] = boot_rom[i];
M[BOOT_UNIT] = (unitno & RK_M_NUMDR) << 1;
saved_PC = BOOT_START;
cpu_set_bootpc (BOOT_START);
return SCPE_OK;
}

View File

@@ -1,6 +1,6 @@
/* pdp8_rl.c: RL8A cartridge disk simulator
Copyright (c) 1993-2011, Robert M Supnik
Copyright (c) 1993-2013, 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 @@
rl RL8A cartridge disk
17-Sep-13 RMS Changed to use central set_bootpc routine
25-Oct-05 RMS Fixed IOT 61 decode bug (David Gesswein)
16-Aug-05 RMS Fixed C++ declaration and cast problems
04-Jan-04 RMS Changed attach routine to use sim_fsize
@@ -699,6 +700,6 @@ if (rl_dib.dev != DEV_RL) /* only std devno */
rl_unit[unitno].TRK = 0;
for (i = 0; i < BOOT_LEN; i++)
M[BOOT_START + i] = boot_rom[i];
saved_PC = BOOT_START;
cpu_set_bootpc (BOOT_START);
return SCPE_OK;
}

View File

@@ -1,6 +1,6 @@
/* pdp8_rx.c: RX8E/RX01, RX28/RX02 floppy disk simulator
Copyright (c) 1993-2011, Robert M Supnik
Copyright (c) 1993-2013, 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,8 @@
rx RX8E/RX01, RX28/RX02 floppy disk
17-Sep-13 RMS Changed to use central set_bootpc routine
03-Sep-13 RMS Added explicit void * cast
15-May-06 RMS Fixed bug in autosize attach (Dave Gesswein)
04-Jan-04 RMS Changed sim_fsize calling sequence
05-Nov-03 RMS Fixed bug in RX28 read status (Charles Dickman)
@@ -366,7 +368,7 @@ return;
t_stat rx_svc (UNIT *uptr)
{
int32 i, func, byptr, bps, wps;
int8 *fbuf = uptr->filebuf;
int8 *fbuf = (int8 *) uptr->filebuf;
uint32 da;
#define PTR12(x) (((x) + (x) + (x)) >> 1)
@@ -742,13 +744,13 @@ if (rx_dib.dev != DEV_RX) /* only std devno */
if (rx_28) {
for (i = 0; i < BOOT2_LEN; i++)
M[BOOT2_START + i] = boot2_rom[i];
saved_PC = BOOT2_ENTRY;
cpu_set_bootpc (BOOT2_ENTRY);
}
else {
for (i = 0; i < BOOT_LEN; i++)
M[BOOT_START + i] = boot_rom[i];
M[BOOT_INST] = unitno? 07024: 07004;
saved_PC = BOOT_ENTRY;
cpu_set_bootpc (BOOT_ENTRY);
}
return SCPE_OK;
}

View File

@@ -1,6 +1,6 @@
/* pdp8_sys.c: PDP-8 simulator interface
Copyright (c) 1993-2011, Robert M Supnik
Copyright (c) 1993-2013, 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,7 @@
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from Robert M Supnik.
17-Sep-13 RMS Fixed recognition of initial field change (Dave Gesswein)
24-Mar-09 RMS Added link to FPP
24-Jun-08 RMS Fixed bug in new rim loader (Don North)
24-May-08 RMS Fixed signed/unsigned declaration inconsistency
@@ -191,11 +192,11 @@ t_stat sim_load_bin (FILE *fi)
int32 hi, lo, wd, csum, t;
uint32 field, newf, origin;
csum = origin = field = newf = 0; /* init */
do { /* skip leader */
if ((hi = sim_bin_getc (fi, &newf)) == EOF)
return SCPE_FMT;
} while ((hi == 0) || (hi >= 0200));
csum = origin = field = newf = 0; /* init */
for (;;) { /* data blocks */
if ((lo = sim_bin_getc (fi, &newf)) == EOF) /* low char */
return SCPE_FMT;

View File

@@ -1,6 +1,6 @@
/* pdp8_td.c: PDP-8 simple DECtape controller (TD8E) simulator
Copyright (c) 1993-2011, Robert M Supnik
Copyright (c) 1993-2013, 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 @@
td TD8E/TU56 DECtape
17-Sep-13 RMS Changed to use central set_bootpc routine
23-Mar-11 RMS Fixed SDLC to clear AC (from Dave Gesswein)
23-Jun-06 RMS Fixed switch conflict in ATTACH
16-Aug-05 RMS Fixed C++ declaration and cast problems
@@ -100,7 +101,7 @@
/* 16b, 18b, 36b DECtape constants */
#define D18_WSIZE 6 /* word sizein lines */
#define D18_WSIZE 6 /* word size in lines */
#define D18_BSIZE 384 /* block size in 12b */
#define D18_TSIZE 578 /* tape size */
#define D18_LPERB (DT_HTLIN + (D18_BSIZE * DT_WSIZE) + DT_HTLIN)
@@ -752,7 +753,7 @@ if (td_dib.dev != DEV_TD8E)
td_unit[unitno].pos = DT_EZLIN;
for (i = 0; i < BOOT_LEN; i++)
M[BOOT_START + i] = boot_rom[i];
saved_PC = BOOT_START;
cpu_set_bootpc (BOOT_START);
return SCPE_OK;
}
@@ -912,7 +913,8 @@ int32 td_set_mtk (int32 code, int32 u, int32 k)
{
int32 i;
for (i = 5; i >= 0; i--) tdb_mtk[u][k++] = (code >> i) & 1;
for (i = 5; i >= 0; i--)
tdb_mtk[u][k++] = (code >> i) & 1;
return k;
}

View File

@@ -1,6 +1,6 @@
/* pdp8_ttx.c: PDP-8 additional terminals simulator
Copyright (c) 1993-2012, Robert M Supnik
Copyright (c) 1993-2013, 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 @@
ttix,ttox PT08/KL8JA terminal input/output
11-Oct-13 RMS Poll TTIX immediately to pick up initial connect (Mark Pizzolato)
18-Apr-12 RMS Revised to use clock coscheduling
19-Nov-08 RMS Revised for common TMXR show routines
07-Jun-06 RMS Added UNIT_IDLE flag
@@ -360,7 +361,7 @@ t_stat r;
r = tmxr_attach (&ttx_desc, uptr, cptr); /* attach */
if (r != SCPE_OK) /* error */
return r;
sim_activate (uptr, tmxr_poll); /* start poll */
sim_activate (uptr, 0); /* start poll at once */
return SCPE_OK;
}