First Commit of my working state
[simh.git] / HP2100 / hp2100_cpu0.c
1 /* hp2100_cpu0.c: HP 1000 unimplemented instruction set stubs
2
3 Copyright (c) 2006-2008, J. David Bryan
4
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:
11
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
14
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 THE AUTHOR 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.
21
22 Except as contained in this notice, the name of the author 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 the author.
25
26 CPU0 Unimplemented firmware option instructions
27
28 26-Feb-08 HV Removed and implemented "cpu_vis" and "cpu_signal"
29 22-Nov-07 JDB Removed and implemented "cpu_rte_ema"
30 12-Nov-07 JDB Removed and implemented "cpu_rte_vma" and "cpu_rte_os"
31 01-Dec-06 JDB Removed and implemented "cpu_sis".
32 26-Sep-06 JDB Created
33
34 This file contains template simulations for the firmware options that have
35 not yet been implemented. When a given firmware option is implemented, it
36 should be moved out of this file and into another (or its own, depending on
37 complexity).
38
39 Primary references:
40 - HP 1000 M/E/F-Series Computers Technical Reference Handbook
41 (5955-0282, Mar-1980)
42 - HP 1000 M/E/F-Series Computers Engineering and Reference Documentation
43 (92851-90001, Mar-1981)
44 - Macro/1000 Reference Manual (92059-90001, Dec-1992)
45
46 Additional references are listed with the associated firmware
47 implementations, as are the HP option model numbers pertaining to the
48 applicable CPUs.
49 */
50
51 #include "hp2100_defs.h"
52 #include "hp2100_cpu.h"
53 #include "hp2100_cpu1.h"
54
55
56 t_stat cpu_ds (uint32 IR, uint32 intrq); /* Distributed System */
57
58
59 /* Distributed System
60
61 Distributed System firmware was provided with the HP 91740A DS/1000 product
62 for use with the HP 12771A (12665A) Serial Interface and 12773A Modem
63 Interface system interconnection kits. Firmware permitted high-speed
64 transfers with minimum impact to the processor. The advent of the
65 "intelligent" 12794A and 12825A HDLC cards, the 12793A and 12834A Bisync
66 cards, and the 91750A DS-1000/IV software obviated the need for CPU firmware,
67 as essentially the firmware was moved onto the I/O cards.
68
69 Primary documentation for the DS instructions has not been located. However,
70 examination of the DS/1000 sources reveals that two instruction were used by
71 the DVA65 Serial Interface driver (91740-18071) and placed in the trap cells
72 of the communications interfaces. Presumably they handled interrupts from
73 the cards.
74
75 Implementation of the DS instructions will also require simulation of the
76 12665A Hardwired Serial Data Interface Card and the 12620A RTE Privileged
77 Interrupt Fence. These are required for DS/1000.
78
79 Option implementation by CPU was as follows:
80
81 2114 2115 2116 2100 1000-M 1000-E 1000-F
82 ------ ------ ------ ------ ------ ------ ------
83 N/A N/A N/A N/A 91740A 91740B 91740B
84
85 The routines are mapped to instruction codes as follows:
86
87 Instr. 1000-M 1000-E/F Description
88 ------ ------ -------- ----------------------------------------------
89 105520 105300 "Open loop" (trap cell handler)
90 105521 105301 "Closed loop" (trap cell handler)
91 105522 105302 [unknown]
92 [test] 105524 105304 [self test]
93
94 Notes:
95
96 1. The E/F-Series opcodes were moved from 105340-357 to 105300-317 at
97 revision 1813.
98
99 2. DS/1000 ROM data are available from Bitsavers.
100
101 Additional references (documents unavailable):
102 - HP 91740A M-Series Distributed System (DS/1000) Firmware Installation
103 Manual (91740-90007).
104 - HP 91740B Distributed System (DS/1000) Firmware Installation Manual
105 (91740-90009).
106 */
107
108 static const OP_PAT op_ds[16] = {
109 OP_N, OP_N, OP_N, OP_N, /* --- --- --- --- */
110 OP_N, OP_N, OP_N, OP_N, /* --- --- --- --- */
111 OP_N, OP_N, OP_N, OP_N, /* --- --- --- --- */
112 OP_N, OP_N, OP_N, OP_N /* --- --- --- --- */
113 };
114
115 t_stat cpu_ds (uint32 IR, uint32 intrq)
116 {
117 t_stat reason = SCPE_OK;
118 OPS op;
119 uint32 entry;
120
121 if ((cpu_unit.flags & UNIT_DS) == 0) /* DS option installed? */
122 return stop_inst;
123
124 entry = IR & 017; /* mask to entry point */
125
126 if (op_ds[entry] != OP_N)
127 if (reason = cpu_ops (op_ds[entry], op, intrq)) /* get instruction operands */
128 return reason;
129
130 switch (entry) { /* decode IR<3:0> */
131
132 default: /* others undefined */
133 reason = stop_inst;
134 }
135
136 return reason;
137 }