15be18452a201b4baf89715477d4b00ad7370d88
1 /* pdp8_tsc.c: PDP-8 ETOS timesharing option board (TSC8-75)
3 Copyright (c) 2003-2005, Robert M Supnik
5 Permission is hereby granted, free of charge, to any person obtaining a
6 copy of this software and associated documentation files (the "Software"),
7 to deal in the Software without restriction, including without limitation
8 the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 and/or sell copies of the Software, and to permit persons to whom the
10 Software is furnished to do so, subject to the following conditions:
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 ROBERT M SUPNIK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 Except as contained in this notice, the name of Robert M Supnik shall not be
23 used in advertising or otherwise to promote the sale, use or other dealings
24 in this Software without prior written authorization from Robert M Supnik.
26 This module is based on Bernhard Baehr's PDP-8/E simulator
28 PDP-8/E Simulator Source Code
30 Copyright ) 2001-2003 Bernhard Baehr
32 TSC8iots.c - IOTs for the TSC8-75 Board plugin
34 This program is free software; you can redistribute it and/or modify
35 it under the terms of the GNU General Public License as published by
36 the Free Software Foundation; either version 2 of the License, or
37 (at your option) any later version.
39 This program is distributed in the hope that it will be useful,
40 but WITHOUT ANY WARRANTY; without even the implied warranty of
41 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42 GNU General Public License for more details.
44 You should have received a copy of the GNU General Public License
45 along with this program; if not, write to the Free Software
46 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
48 tsc TSC8-75 option board
51 #include "pdp8_defs.h"
55 extern int32 tsc_ir
; /* "ERIOT" */
56 extern int32 tsc_pc
; /* "ERTB" */
57 extern int32 tsc_cdf
; /* "ECDF" */
58 extern int32 tsc_enb
; /* enable */
60 #define UNIT_V_SN699 (UNIT_V_UF + 0) /* SN 699 or above */
61 #define UNIT_SN699 (1 << UNIT_V_SN699)
64 int32
tsc (int32 IR
, int32 AC
);
65 t_stat
tsc_reset (DEVICE
*dptr
);
67 /* TSC data structures
69 tsc_dev TSC device descriptor
70 tsc_unit TSC unit descriptor
71 tsc_reg TSC register list
74 DIB tsc_dib
= { DEV_TSC
, 1, { &tsc
} };
76 UNIT tsc_unit
= { UDATA (NULL
, UNIT_SN699
, 0) };
79 { ORDATA (IR
, tsc_ir
, 12) },
80 { ORDATA (PC
, tsc_pc
, 12) },
81 { FLDATA (CDF
, tsc_cdf
, 0) },
82 { FLDATA (ENB
, tsc_enb
, 0) },
83 { FLDATA (INT
, int_req
, INT_V_TSC
) },
88 { UNIT_SN699
, UNIT_SN699
, "ESME", "ESME", NULL
},
89 { UNIT_SN699
, 0, "no ESME", "NOESME", NULL
},
94 "TSC", &tsc_unit
, tsc_reg
, tsc_mod
,
96 NULL
, NULL
, &tsc_reset
,
98 &tsc_dib
, DEV_DISABLE
| DEV_DIS
103 int32
tsc (int32 IR
, int32 AC
)
105 switch (IR
& 07) { /* decode IR<9:11> */
108 tsc_enb
= 0; /* disable int req */
109 int_req
= int_req
& ~INT_TSC
; /* clear flag */
113 return (int_req
& INT_TSC
)? IOT_SKP
+ AC
: AC
; /* skip on int req */
116 int_req
= int_req
& ~INT_TSC
; /* clear int req */
120 AC
= AC
| ((tsc_ir
>> 3) & 07); /* read "ERIOT"<6:8> */
121 if (tsc_cdf
) AC
= AC
| IOT_SKP
; /* if cdf, skip */
129 if (tsc_unit
.flags
& UNIT_SN699
) { /* enabled? */
130 if (tsc_cdf
&& ((tsc_ir
& 070) >> 3) == (SF
& 07)) {
150 t_stat
tsc_reset (DEVICE
*dptr
)
156 int_req
= int_req
& ~INT_TSC
;