GE-115 Emulator
An Emulator of the General Electrics GE-115 computer
msl-commands.c
Go to the documentation of this file.
1#include "ge.h"
2#include "log.h"
3#include "bit.h"
4#include "signals.h"
5#include "alu_logic.h"
6#include "alu_bin.h"
7#include "alu_dec.h"
8#include "alu_reg.h"
9#include "alu_cc.h"
10
11#ifndef MSL_COMMANDS_INCLUDED_BY_MSL_STATES
12# error This file should be include by msl-states.c and not compiled directly
13#endif
14
15#define CC { ge_log(LOG_ERR, "implement command %s\n", __FUNCTION__); }
16
17/* Commands To Load The Registers */
18/* ------------------------------ */
19
20static void CO00(struct ge* ge) { ge->rPO = NI_knot(ge); }
21static void CO01(struct ge* ge) { ge->rV1 = NI_knot(ge); }
22static void CO02(struct ge* ge) { ge->rV2 = NI_knot(ge); }
23static void CO03(struct ge* ge) { ge->rV3 = NI_knot(ge); }
24static void CO04(struct ge* ge) { ge->rV4 = NI_knot(ge); }
25
26static void CI00(struct ge* ge) { CO00(ge); }
27static void CI01(struct ge* ge) { CO01(ge); }
28static void CI02(struct ge* ge) { CO02(ge); }
29static void CI03(struct ge* ge) { CO03(ge); }
30static void CI04(struct ge* ge) { CO04(ge); }
31static void CI05(struct ge* ge) { ge->rL1 = NI_knot(ge); }
32static void CI06(struct ge* ge) { ge->rL2 = NI_knot(ge) & 0x00ff; }
33static void CI07(struct ge* ge) { ge->rL3 = NI_knot(ge); }
34static void CI08(struct ge* ge) { ge->rFO = (NI_knot(ge) & 0x00ff); }
35static void CI09(struct ge* ge) { ge->rRI = (NI_knot(ge) & 0xff00) >> 8; }
36
37/* NO Knot Selection Commands */
38/* -------------------------- */
39
40static void CO10(struct ge* ge) { ge->kNO.cmd = KNOT_PO_IN_NO; }
41static void CO11(struct ge* ge) { ge->kNO.cmd = KNOT_V1_IN_NO; }
42static void CO12(struct ge* ge) { ge->kNO.cmd = KNOT_V2_IN_NO; }
43static void CO13(struct ge* ge) { ge->kNO.cmd = KNOT_V3_IN_NO; }
44static void CO14(struct ge* ge) { ge->kNO.cmd = KNOT_V4_IN_NO; }
45static void CO16(struct ge* ge) { ge->kNO.cmd = KNOT_L2_IN_NO; }
46/* "Forcing in NO21": enable the program forcings (CO90-CO97) onto quartets
47 * 2,1 of the NO knot. Previously assigned the enum constant to the forcings
48 * VALUE (leaving force_mode off), which made every CO18+CO9x address build
49 * inert. */
50static void CO18(struct ge *ge) { ge->kNO.force_mode = KNOT_FORCING_NO_21; }
51
52/* Pulse-decay of the NO selection (see ge.h KNOT_NONE_IN_NO). */
53static void NO_UNDRIVEN(struct ge *ge) { ge->kNO.cmd = KNOT_NONE_IN_NO; }
54
55static void CI10(struct ge* ge) { CO10(ge); }
56static void CI11(struct ge* ge) { CO11(ge); }
57static void CI12(struct ge* ge) { CO12(ge); }
58static void CI15(struct ge* ge) { ge->kNO.cmd = KNOT_L1_IN_NO; }
59static void CI16(struct ge* ge) { CO16(ge); }
60static void CI17(struct ge* ge) { ge->kNO.cmd = KNOT_L3_IN_NO; }
61static void CI19(struct ge* ge) { ge->kNO.force_mode = KNOT_FORCING_NO_43; }
62static void CI20(struct ge* ge) { ge->kNO.cmd = KNOT_AM_IN_NO; }
63static void CI21(struct ge* ge) { ge->kNO.cmd = KNOT_RI_IN_NO_43; }
64
65
66/* VO, BO, RO Loading Commands */
67/* --------------------------- */
68
69static void CO30(struct ge* ge) { ge->memory_command = MC_READ; }
70static void CO31(struct ge* ge) { ge->memory_command = MC_WRITE; }
71static void CO35(struct ge* ge) { /* "reset int. error"? (cpu fo. 105) */ }
72
73static void CI32(struct ge* ge) {
74 ge->rRO = NO_knot(ge) >> 8;
76}
77
78static void CI33(struct ge* ge) {
79 ge->rRO = NO_knot(ge) & 0x00ff;
81}
82
83static void CI34(struct ge* ge) {
84 ge->rRO = NE_knot(ge);
85}
86
87static void CI38(struct ge *ge)
88{
89 /* Enable set of aver & alto (cpu fo. 105) */
90 ge->AVER = verified_condition(ge);
91
92 /* (One) possible (ALTO) set condition (is): the ACOV or ACON
93 * switches are insterted, an the related condition is verified
94 * (cpu fo. 98) */
96 ge->ALTO = 1;
97
98 if (!ge->AVER && ge->console_switches.ACON)
99 ge->ALTO = 1;
100}
101
102static void CI39(struct ge *ge)
103{
104 /* Reset AVER, it also resets the FF AINI and PUC1 (cpu fo. 105) */
105 ge->AVER = 0;
106 ge->AINI = 0;
107 ge->PIC1 = 0;
108
109 /* intermediate fo. 10 B6 */
110 ge->RASI = 0;
111
112 if (!PUC1(ge))
113 ge->RC00 = 1;
114}
115
116/* Count And Arithmetical Unit Commands */
117/* ------------------------------------ */
118
119static void CO40(struct ge* ge) { ge->counting_network.cmds.decresing = 1; };
120static void CO41(struct ge* ge) { ge->counting_network.cmds.from_zero = 1; };
121static void CO48(struct ge* ge)
122{
123 /* most probably incorrect, "set urpe/urpu" (cpu fo. 106) */
124 ge->URPE = 1;
125 ge->URPU = 1;
126}
127
128static void CO49(struct ge* ge) {
129 /* most probably incorrect, "reset urpe/urpu" (cpu fo. 106) */
130 ge->URPE = 0;
131 ge->URPU = 0;
132};
133
134/* Remaining single-address architectural commits. The immediate family no
135 * longer lives here: its CPU[7] CI/CO timing rows drive the normal knots,
136 * memory cycle and UA. */
137static uint16_t eff_v1_l2(struct ge* ge);
138
139/* Change registers are memory-mapped, 16-bit big-endian, at addresses
140 * 240 + N*2 (N = 0..7). The register-op aux char (in L1) carries the 4-bit
141 * register code 1000..1111; the register index N = code & 7.
142 * NOTE: the code is assumed to sit in the LOW nibble of the aux char —
143 * verify against the funktionalcpu oracle. V1 holds the I1 memory address. */
144/* Register-op aux char format is 1XXX0000: bit 7 = 1, the register number is
145 * bits 4-6, low nibble 0 (confirmed against the funktionalcpu deck, step 0x37
146 * LR with aux 0xE0 -> register 6). N = (aux >> 4) & 7. */
147static uint16_t reg_addr_of(struct ge* ge) { return (uint16_t)(240 + ((ge->rL1 >> 4) & 0x07) * 2); }
148static uint16_t cr_rd16(struct ge* ge, uint16_t a) {
149 return (uint16_t)((ge->mem[a] << 8) | ge->mem[(uint16_t)(a + 1)]);
150}
151static void cr_wr16(struct ge* ge, uint16_t a, uint16_t v) {
152 ge_mem_store8(ge, a, (uint8_t)(v >> 8));
153 ge_mem_store8(ge, (uint16_t)(a + 1), (uint8_t)(v & 0xff));
154 /* cr_wr16 is the register-instruction write path (LR/LA/AMR/SMR/JRT, always
155 * to a change-register slot 240+2N). Keep the addressing cache in sync here
156 * so a register instruction updates live addressing — but a GENERAL memory
157 * write to 0xF0-0xFF (e.g. a destructive memory test) does NOT, leaving
158 * addressing intact. See struct ge::cr_cache. */
159 if (a >= 240 && a <= 254 && !(a & 1))
160 ge->cr_cache[(a - 240) >> 1] = v;
161}
162
163/* Register-op MEMORY operand: the instruction address (V1) points to the
164 * RIGHTMOST (low) byte; the 16-bit value occupies [addr-1 .. addr] (the
165 * LR-AMR-SMR-CMR-STR microcode reads V2 DOWNWARD, V2-1->V2). Confirmed by
166 * funktionalcpu step 0x37: LR cr6 <- mem[0x0621..0x0622], verified by the
167 * CMC against the saved copy. (The change-register storage at 240+2N is the
168 * other way -- high byte first -- handled by cr_rd16/cr_wr16.) */
169static uint16_t mem_rd16_op(struct ge* ge, uint16_t a) {
170 return (uint16_t)((ge->mem[(uint16_t)(a - 1)] << 8) | ge->mem[a]);
171}
172static void mem_wr16_op(struct ge* ge, uint16_t a, uint16_t v) {
173 ge_mem_store8(ge, (uint16_t)(a - 1), (uint8_t)(v >> 8));
174 ge_mem_store8(ge, a, (uint8_t)(v & 0xff));
175}
176
177/* Address modification — bit 15 = absolute/modified flag (CPU[4] §2.5, FO.19-20;
178 * flow chart dwg 14023130, transcribed in reference_operand_fetch_flowchart).
179 *
180 * Every operand address field carries the modify flag in bit 15:
181 * bit 15 = 0 ABSOLUTE: bits 0-14 are the address directly (0..0x7FFF); the
182 * change registers are NOT consulted.
183 * bit 15 = 1 MODIFIED: bits 12-14 select one of the 8 change registers and
184 * EA = change_register[N] + (bits 0-11 displacement), 16-bit wrap.
185 *
186 * The GE-130 resolves this *during operand fetch*: an absolute field is left in
187 * V verbatim (bit 15 = 0, so V < 0x8000); a modified field is reduced to its
188 * 12-bit displacement in V and the change register is then added by the
189 * indexing micro-cycle ED|EC -> EF|EE (per-clock states in msl-states.c,
190 * timing tables CPU[7] p64), which reads the change register from mem[240+2N]
191 * byte by byte, leaves the resolved EA in V2 and (for the first operand,
192 * SA = ED|EF with bit 0 set) copies it to V1 (CI01).
193 * So after fetch the operand registers hold the RESOLVED effective address and
194 * execution uses them directly — eff_v1_l2 / CI00s / EXEC_SS just mask to the
195 * 15-bit address space. The change registers live at mem[240+2N] and default to
196 * base[N] = N<<12 at reset (ge_clear); programs reload a base via LR/LA/AMR. */
197
198/* Effective V1 for single-address PM/SI ops: V1 already holds the resolved EA
199 * (absolute field, or change_register+displacement after the indexing cycle). */
200static uint16_t eff_v1_l2(struct ge* ge) { return ge->rV1 & 0x7FFFu; }
201
202/* Jump target: NI re-assembles the resolved target field at TI05 (for a modified
203 * jump it was resolved into V2 by the indexing cycle). Mask to the address space. */
204static void CI00s(struct ge* ge) {
205 ge->rPO = NI_knot(ge) & 0x7FFFu;
206}
207
208/* JRT (Jump Return, op 0x41): deposits the address of the subsequent instruction
209 * (rPO before the jump rewrites it at TI05/CI00s) into index register 7
210 * (mem 254/255). Unconditional, per CPU[4] sec.5.5.6.2 / 5.6.5.1: the link is
211 * reserved even when the conditional form does not take the jump. */
212
213/* SS (Storage-to-Storage) data-op execution (hybrid one-shot).
214 *
215 * EXEC_SS fires in the beta phase (state 64|65 family, TO65), once the
216 * alpha operand-fetch micro-loop has resolved both
217 * operands: E7 routes an SS op to beta via its documented CU rows (absolute
218 * second operand), or through the indexing micro-cycle ED|EC -> EF|EE first
219 * (modified second operand). The per-clock executive-phase recipes for the
220 * data ops (CPU[7] sheets 44+ / timing tables p93-p120) are NOT transcribed —
221 * the operation happens once here via the alu_* helpers; see
222 * docs/flowchart-sheets.md for the fidelity roadmap.
223 *
224 * Operand layout on entering beta:
225 * V1 = destination address
226 * V2 = source address
227 * L1 = length byte
228 *
229 * Single-length ops (MVC/NC/OC/XC/CMC/TL/UPK/PK/EDT):
230 * len = (rL1 & 0xff) + 1
231 *
232 * Two-length decimal ops (AP/SP/MP/DP/MVP/CMP/PKS/UPKS):
233 * alen = ((rL1 >> 4) & 0xf) + 1 (high nibble + 1)
234 * blen = (rL1 & 0xf) + 1 (low nibble + 1)
235 */
236static void EXEC_SS(struct ge *ge)
237{
238 uint16_t len = (uint16_t)((ge->rL1 & 0xff) + 1); /* up to 256 (LL=0xff); must not be uint8_t */
239 uint8_t alen = ((ge->rL1 >> 4) & 0xf) + 1;
240 uint8_t blen = (ge->rL1 & 0x0f) + 1;
241 /* SS effective addresses: V1 (dest) and V2 (src) already hold the resolved
242 * effective address after operand fetch (absolute field verbatim, or
243 * change_register+displacement via the indexing micro-cycle). Mask to the
244 * 15-bit address space. */
245 uint16_t dst = ge->rV1 & 0x7FFFu;
246 uint16_t src = ge->rV2 & 0x7FFFu;
247
248 switch (ge->rFO) {
249 case MVC_OPCODE:
250 alu_mvc(ge, dst, src, len);
251 break;
252 case NC_OPCODE:
253 alu_nc(ge, dst, src, len);
254 break;
255 case OC_OPCODE:
256 alu_oc(ge, dst, src, len);
257 break;
258 case XC_OPCODE:
259 alu_xc(ge, dst, src, len);
260 break;
261 case CMC_OPCODE:
262 alu_cmc(ge, dst, src, len);
263 break;
264 case TR_OPCODE:
265 alu_tr(ge, dst, len, src);
266 break;
267 case UPK_OPCODE:
268 alu_upk(ge, dst, len-1, src, len-1);
269 break;
270 case PK_OPCODE:
271 alu_pk(ge, dst, len-1, src, len-1);
272 break;
273 case EDT_OPCODE:
274 alu_edt(ge, dst, len, src);
275 break;
276 case MVP_OPCODE:
277 alu_mvp(ge, dst, alen-1, src, blen-1);
278 break;
279 case CMP_OPCODE:
280 alu_cmp(ge, dst, alen-1, src, blen-1);
281 break;
282 case AP_OPCODE:
283 alu_ap(ge, dst, alen-1, src, blen-1);
284 break;
285 case SP_OPCODE:
286 alu_sp(ge, dst, alen-1, src, blen-1);
287 break;
288 case MP_OPCODE:
289 alu_mp(ge, dst, alen-1, src, blen-1);
290 break;
291 case DP_OPCODE:
292 alu_dp(ge, dst, alen-1, src, blen-1);
293 break;
294 case PKS_OPCODE:
295 alu_pks(ge, dst, alen-1, src, blen-1);
296 break;
297 case UPKS_OPCODE:
298 alu_upks(ge, dst, alen-1, src, blen-1);
299 break;
300 /* AB/SB/AD/SD/MVQ/CMQ no longer reach the one-shot: they run their
301 * per-clock executive states (cp07 fo.140-143), gated out of
302 * ss_hybrid_family in msl-states.c. The alu_ab/../alu_cmq
303 * implementations stay in alu_reg.c/alu_bin.c for the unit tests
304 * that pin their arithmetic. */
305 /* Search Right/Left (SR=0xD9, SL=0xDB), SS1 format "SR len, A1, A2":
306 * A1 (V1=dst) = leftmost byte of the search field
307 * A2 (V2=src) = address of the 1-byte model to search for
308 * result address -> change/segment register 7 (mem[0xFE..0xFF], BE)
309 * The result-register location is confirmed by the funktionalcpu deck
310 * (the instruction following SR at 0x03dc reads mem[0x00FE]); the
311 * model-byte source (mem[A2]) is the best-supported reading of the
312 * SS1 two-address form and remains MEDIUM confidence pending the
313 * search-instruction page image (docs/ISA.md §6.10). */
314 case SR_OPCODE: {
315 uint16_t r7 = (uint16_t)((ge->mem[0xFE] << 8) | ge->mem[0xFF]);
316 alu_sr(ge, &r7, dst, len, ge->mem[src]);
317 ge_mem_store8(ge, 0xFE, (uint8_t)(r7 >> 8));
318 ge_mem_store8(ge, 0xFF, (uint8_t)(r7 & 0xFF));
319 break;
320 }
321 case SL_OPCODE: {
322 uint16_t r7 = (uint16_t)((ge->mem[0xFE] << 8) | ge->mem[0xFF]);
323 alu_sl(ge, &r7, dst, len, ge->mem[src]);
324 ge_mem_store8(ge, 0xFE, (uint8_t)(r7 >> 8));
325 ge_mem_store8(ge, 0xFF, (uint8_t)(r7 & 0xFF));
326 break;
327 }
328 default:
329 ge_log(LOG_ERR, "EXEC_SS: unknown SS opcode 0x%02x\n", ge->rFO);
330 break;
331 }
332}
333
334/* EPER "examine abnormal conditions": load the channel-1 peripheral status
335 * into RO so the qualitative-result decode (DU95 = !RO1 && !RO2 && RO6 = "no
336 * error") reflects the real status. Our integrated-reader feed is always
337 * clean (no parity/format error; CE02 even ignores the parity check), so the
338 * status is no-error: RO6 set, error bits (RO1/RO2) clear. A real error would
339 * be reported here once error injection is modelled. */
340static void CE_chan1_status(struct ge *ge)
341{
342 /* Default: RO6=1 (operation OK), RO1=RO2=0 (no error) -> DU95=1 ("no
343 * error"). When inject_chan1_status is non-zero a test/harness is injecting
344 * an abnormal condition: report that status byte instead (e.g. 0x42 sets
345 * RO1, so DU95 reads "error" and the EPER examine branch fires). */
347}
348
349/* CI-side counting selection: staged, becomes active at TO65 (second
350 * phase) — see ge_counting_network.ci_cmds. */
351static void CI40(struct ge *ge) { ge->counting_network.ci_cmds.decresing = 1; }
352static void CI41(struct ge *ge) { ge->counting_network.ci_cmds.from_zero = 1; }
353static void CI42(struct ge *ge) { ge->counting_network.ci_cmds.from_04 = 1; }
354static void CI44(struct ge *ge) { ge->counting_network.ci_cmds.stop_07 = 1; }
355
356/* Arithmetic-unit mode selection (cp06 ch.190/196 and CPU[7] timing sheets
357 * fo.43-45). The manual issues combinations of these lines and admits the
358 * resulting byte through CI68/CI69 later in the same state:
359 *
360 * CI45+CI46 AND
361 * CI45+CI47 XOR
362 * CI45+CI46+CI47 OR
363 * CI46 decimal add (no CI45: arithmetic branch)
364 * CI46+CI47 decimal subtract
365 * CI47 binary subtract
366 * (none) binary add
367 *
368 * The gates that turn these three lines into the concentrator's function code
369 * are transcribed in signals.h (UCO01/UCO11/UCO21/UCO41/UCOA1) from cp06
370 * ch.087 -- see docs/transcriptions/ua-function-decode.md.
371 */
372static void CI45(struct ge *ge) { ge->ua_controls.logic = 1; }
373static void CI46(struct ge *ge) { ge->ua_controls.decimal_and = 1; }
374static void CI47(struct ge *ge) { ge->ua_controls.subtract_xor = 1; }
375
376/* cp07 fo.142 issues CI50 from the same gate DE99A0 {(AD+SD+CMQ)} that
377 * issues CI46, so the decimal family always raises the pair together. */
378static void CI50(struct ge *ge) { ge->ua_controls.low_zone_only = 1; }
379
380
381/* NI Knot Selection Commands */
382/* -------------------------- */
383
384static void CI60(struct ge *ge) { ge->kNI.ni4 = NS_RO2; }
385static void CI61(struct ge *ge) { ge->kNI.ni3 = NS_RO2; }
386static void CI62(struct ge *ge) { ge->kNI.ni2 = NS_RO2; }
387static void CI63(struct ge *ge) { ge->kNI.ni1 = NS_RO2; }
388static void CI64(struct ge *ge) { ge->kNI.ni4 = NS_RO1; }
389static void CI65(struct ge *ge) { ge->kNI.ni3 = NS_RO1; }
390static void CI66(struct ge *ge) { ge->kNI.ni2 = NS_RO1; }
391static void CI67(struct ge *ge) { ge->kNI.ni1 = NS_RO1; }
392/* "UA in NI": the same command selects which byte of BO drives the UA and
393 * which half of NI the UA output drives (cpu fo. 125-126). gemu latches the
394 * UA output (BO byte + RO, binary, carry through URPE) at command time; the
395 * NI knot then reads the latch through NS_UA2/NS_UA1.
396 *
397 * Used by the modified-address indexing micro-cycle (CPU[7] p64): ED|EC adds
398 * the change-register low byte (CI69, carry FFs freshly reset by CO49) and
399 * EF|EE adds the high byte with the propagated carry (CI68).
400 *
401 * CI68 masks BO bits 15-12 to the displacement's quartet 3: the operand field
402 * is a 12-bit displacement (bits 12-14 modifier, 15 the modify flag, both
403 * stripped during fetch), and the fetch leaves quartet 4 of the operand
404 * register holding counting-network residue that must not enter the add. The
405 * hardware mechanism for excluding it has not been located in the timing
406 * tables — open question; recheck the UA pages before trusting bit-level
407 * fidelity here. */
408/* Flow chart E4/E5 box "0 -> V_4 [R007]" (dwg 14023130, transcribed in
409 * reference_operand_fetch_flowchart): on a MODIFIED address the top quartet of
410 * the operand register is explicitly ZEROED at fetch (the modifier+flag nibble
411 * is stripped; the change register is added later in ED|EC->EF|EE). Without
412 * this, gemu's NI quartet-4 default (the counting network) leaks program-
413 * counter bits into V's quartet 4 for code running at addresses >= 0x1000 —
414 * the "fetch residue" the old CI68 nibble mask compensated for. The silicon
415 * has no such mask (cp06 ch.087/088: all eight BO->UA muxes identical). */
416static void NI4_ZERO(struct ge *ge) { ge->kNI.ni4 = NS_ZERO; }
417
418static void CI68(struct ge *ge) {
419 uint8_t bo = (uint8_t)(ge->rBO >> 8);
420 uint8_t ro = (uint8_t)ge->rRO;
421
422 if (ge->ua_controls.logic) {
424 ge->rUA = bo | ro;
425 else if (ge->ua_controls.decimal_and)
426 ge->rUA = bo & ro;
427 else if (ge->ua_controls.subtract_xor)
428 ge->rUA = bo ^ ro;
429 else
430 ge->rUA = ro;
431 } else if (ge->ua_controls.decimal_and) {
432 uint8_t carry = ge->URPE;
433
435 ge->ua_controls.low_zone_only, &carry);
436 ge->URPE = carry;
437 } else {
438 unsigned sum = ge->ua_controls.subtract_xor
439 ? ro + (uint8_t)~bo + ge->URPE
440 : bo + ro + ge->URPE;
441 ge->rUA = (uint8_t)sum;
442 ge->URPE = sum > 0xff;
443 }
444 ge->kNI.ni4 = NS_UA2; ge->kNI.ni3 = NS_UA1;
445}
446static void CI69(struct ge *ge) {
447 uint8_t bo = (uint8_t)ge->rBO;
448 uint8_t ro = (uint8_t)ge->rRO;
449
450 if (ge->ua_controls.logic) {
452 ge->rUA = bo | ro;
453 else if (ge->ua_controls.decimal_and)
454 ge->rUA = bo & ro;
455 else if (ge->ua_controls.subtract_xor)
456 ge->rUA = bo ^ ro;
457 else
458 ge->rUA = ro;
459 } else {
460 unsigned sum = ge->ua_controls.subtract_xor
461 ? ro + (uint8_t)~bo + ge->URPE
462 : bo + ro + ge->URPE;
463 ge->rUA = (uint8_t)sum;
464 ge->URPE = sum > 0xff;
465 }
466 ge->kNI.ni2 = NS_UA2; ge->kNI.ni1 = NS_UA1;
467}
468
469/* Commands To Set And Reset FF Of Condition */
470/* ----------------------------------------- */
471
472static void CI70(struct ge* ge) { SET_BIT(ge->ffFI, 0); }
473static void CI71(struct ge* ge) { SET_BIT(ge->ffFI, 1); }
474static void CI72(struct ge* ge) { SET_BIT(ge->ffFI, 2); }
475static void CI73(struct ge* ge) { SET_BIT(ge->ffFI, 3); }
476static void CI74(struct ge* ge) { SET_BIT(ge->ffFI, 4); }
477static void CI75(struct ge* ge) { SET_BIT(ge->ffFI, 5); }
478static void CI76(struct ge* ge) { SET_BIT(ge->ffFI, 6); }
479static void CI77(struct ge* ge) { ge->ADIR = 1; }
480static void CI78(struct ge* ge) { ge->ADIR = 0; }
481static void CI80(struct ge* ge) { RESET_BIT(ge->ffFI, 0); }
482static void CI81(struct ge* ge) { RESET_BIT(ge->ffFI, 1); }
483static void CI82(struct ge* ge) { RESET_BIT(ge->ffFI, 2); }
484static void CI83(struct ge* ge) { RESET_BIT(ge->ffFI, 3); }
485static void CI84(struct ge* ge) { RESET_BIT(ge->ffFI, 4); }
486static void CI85(struct ge* ge) { RESET_BIT(ge->ffFI, 5); }
487static void CI86(struct ge* ge) { RESET_BIT(ge->ffFI, 6); }
488
489static void CI87(struct ge* ge) {
490 ge->ALAM = 1;
491 ge->PODI = 1; /* should PODI be set here? */
492}
493
494static void CI88(struct ge* ge) {
495 ge->ALAM = 0;
496 ge->PODI = 0; /* should PODI be set here? */
497}
498
499static void CI89(struct ge* ge) { ge->ALTO = 1; }
500
501/* Commands To Force In NO Knot */
502/* ---------------------------- */
503
504static void CO90(struct ge *ge) { SET_BIT(ge->kNO.forcings, 0); }
505static void CO91(struct ge *ge) { SET_BIT(ge->kNO.forcings, 1); }
506static void CO92(struct ge *ge) { SET_BIT(ge->kNO.forcings, 2); }
507static void CO93(struct ge *ge) { SET_BIT(ge->kNO.forcings, 3); }
508static void CO94(struct ge *ge) { SET_BIT(ge->kNO.forcings, 4); }
509static void CO95(struct ge *ge) { SET_BIT(ge->kNO.forcings, 5); }
510static void CO96(struct ge *ge) { SET_BIT(ge->kNO.forcings, 6); }
511static void CO97(struct ge *ge) { SET_BIT(ge->kNO.forcings, 7); }
512
513/* Commands For External Operations */
514/* -------------------------------- */
515
516static void CE00(struct ge* ge) {
517 /* is PIPO needed?! (intermediate fo. 10 A1*/
518 ge_log(LOG_PERI, "RA <- %x\n", ge->rRO);
519 ge->rRA = ge->rRO;
520}
521
522static void CE01(struct ge* ge) {
523 /* is PIPO needed?! (intermediate fo. 10 A1*/
524 ge_log(LOG_PERI, "RE <- %x\n", ge->rRO);
525 ge->rRE = ge->rRO;
526}
527
528static void CE02(struct ge* ge) {
529 /* admits AEBE: */
530 /* UNIV 1.2µs --> RATE1 nand PC131 --> AEBE */
531 /* AEBE is a control signal sent to ST3 and ST4 */
532
533 /* Unconditionally set by command CE02 (cpu fo. 235) */
534 ge->PIC1 = 1;
535
536 /* Latch PB flip flops (intermediate diagram fo. 9 D 1,2,3) */
537 ge->PB06 = BIT(ge->rL1, 6);
538 ge->PB07 = BIT(ge->rL1, 7);
539
540 /* In case of initial load / TPER, L2 here should be the Z character of
541 * the instructions. It encodes the channel to be used for the transfer.
542 *
543 * If bit 0 of L2 is 0, channel is either 1 or 3,
544 * if bit 0 of L2 is 1, channel is 2.
545 *
546 * (cpu fo. 73)
547 */
548 if (BIT(ge->rL2, 0))
549 ge->PB26 = BIT(ge->rL1, 6);
550
551 if (PC031(ge)) {
552 ge->PB36 = BIT(ge->rL1, 6);
553 ge->PB37 = BIT(ge->rL1, 7);
554 }
555
556 /* parity check ignored */
557}
558
559static void CE03(struct ge *ge) {
560 /* reset IO */
561 uint8_t CE031 = 1;
562 uint8_t TO191 = ge->current_clock == TO19;
563 uint8_t TO651 = ge->current_clock == TO65;
564 uint8_t RECIA = !(CE031 && PC011(ge));
565 uint8_t RECI1 = !RECIA;
566
567 ge_log(LOG_PERI, "RESET I/U (CE03)\n");
568
569 if (TO651 && RECI1) {
570 ge->RIG1 = 0;
571 ge_log(LOG_PERI, "RESETTING RIG1 (CE03)\n", ge->RIG1);
572 } else {
573 ge_log(LOG_PERI, "NOT RESETTING RIG1 (CE03)\n");
574 }
575
576 if (TO191) {
577 ge->RACI = 0;
578 ge_log(LOG_PERI, "RESETTING RACI (CE03)\n");
579 } else {
580 ge_log(LOG_PERI, "NOT RESETTING RACI (CE03)\n");
581 }
582
583 /* maybe more? */
584}
585
586static void CE05(struct ge* ge) {
587 ge_log(LOG_PERI, "TODO: enable selection external error\n");
588}
589
590static void CE06(struct ge *ge) {
591 /* enable set error 1 */
592}
593
594static void CE07(struct ge *ge) {
595 /* set io for can 1, 2 or 3 */
596 uint8_t TO191 = ge->current_clock == TO19;
597
598 if (TO191 && PC011(ge)) {
599 ge->RASI = 1;
600 ge_log(LOG_PERI, "SET RASI (CE07)\n");
601 } else {
602 ge_log(LOG_PERI, "NOT SETTING RASI (CE07)\n");
603 }
604
605 if (TU00A(ge)) {
606 ge_log(LOG_PERI, "TU00A! %d\n", TU00A(ge));
607 }
608}
609
610static void CE08(struct ge *ge) {
611 /* Set VICU.
612 *
613 * The CPU docs tie CE08 to the VICU-support path: TO19 + RETO sets RAVI
614 * (indexed as RAV12), and the later RB111 timing edge stores RACI.
615 * gemu models that latch pair directly even though the wider VICU
616 * ecosystem is still only partially implemented. */
617 uint8_t TO191 = ge->current_clock == TO19;
618
619 ge_log(LOG_PERI, "SET VICU (CE08)\n");
620
621 if (TO191 && ge->RETO) {
622 ge->RAVI = 1;
623 ge_log(LOG_PERI, "SET RAVI (CE08)\n");
624 } else {
625 ge_log(LOG_PERI, "NOT SETTING RAVI (CE08)\n");
626 }
627
628 if (ge->RAVI && RB111(ge)) {
629 ge->RACI = 1;
630 ge_log(LOG_PERI, "SET RACI (CE08)\n");
631 } else {
632 ge_log(LOG_PERI, "NOT SETTING RACI (CE08)\n");
633 }
634}
635
636static void CE09(struct ge *ge) {
637 /* character request */
638
639 /* emits TU101: */
640 /* UNIV 1.2µs --> RT111 */
641
642 uint8_t RT111 = 1;
643
644 /* intermediate fo 14 D3 */
645 uint8_t TU03A = !(RT111 && PC121(ge));
646 uint8_t TU03 = !TU03A;
647
648 if (TU03)
650}
651
652/* CE16 — "Carica Buffer Stampante / Load Printer Buffer" (channel-2 OUTPUT, rSI
653 * transfer state 02/03; flow chart 14023130₁, CPU[7] render-pg 36). Hands the
654 * character just read from memory into RO to the integrated printer over the
655 * channel-2 output line. The printer sink renders it through the GE graphic set.
656 * No-op if no channel-2 sink is attached. */
657static void CE16(struct ge *ge) {
658 channel_accept_output(ge, &ge->channel2, (uint8_t)(ge->rRO & 0xff));
659}
660
661static void CE10(struct ge *ge) {
662 /* send command */
663
664 /* emits TU201: UNIV 1.2µs --> RT121 */
665 ge->RT121 = 1;
666
667 /* UNIV seems a delay line to synchronise the hardware, let's
668 * ignore the exact timings. */
670}
671
672static void CE11(struct ge* ge) {
673 ge->RT131 = 1;
674
675 /* UNIV seems a delay line to synchronise the hardware, let's
676 * ignore the exact timings. */
677
678 /* ad hoc logic, this should be conditioned by TU30C and TU30D
679 * (intermediate fo 14, B4 B5) to send the command only to the
680 * specified units, but the signals don't fully work here */
681
682 if (PC131(ge))
684
685 if (PC141(ge))
687}
688
689static void CE18(struct ge *ge) {
690 /* enable reset RIAP */
691 ge_log(LOG_PERI, "RESET RIAP\n");
692
693 uint8_t TO801 = ge->current_clock == TO80;
694
695 if (TO801 && RIUC(ge)) {
696 ge->RC00 = 0;
697 ge_log(LOG_PERI, "RESETING RC00 (CE18)\n");
698 } else {
699 ge_log(LOG_PERI, "NOT RESETING RC00 (CE18)\n");
700 }
701
702 if (TO801 && RESI(ge)) {
703 ge->RC01 = 0;
704 ge_log(LOG_PERI, "RESETING RC01 (CE18)\n");
705 } else {
706 ge_log(LOG_PERI, "NOT RESETING RC01 (CE18)\n");
707 }
708
709 if (TO801 && RES2(ge)) {
710 ge->RC02 = 0;
711 ge_log(LOG_PERI, "RESETING RC02 (CE18)\n");
712 } else {
713 ge_log(LOG_PERI, "NOT RESETING RC02 (CE18)\n");
714 }
715
716 if (TO801 && RES3(ge)) {
717 ge->RC03 = 0;
718 ge_log(LOG_PERI, "RESETING RC03 (CE18)\n");
719 } else {
720 ge_log(LOG_PERI, "NOT RESETING RC03 (CE18)\n");
721 }
722}
723
724static void CE19(struct ge *ge) {
725 /* reset selection can 3 */
726}
727
728
729/* Future States Commands */
730/* ---------------------- */
731
732/* Set S0 */
733static void CU00(struct ge* ge) { SET_BIT(ge->future_state, 0); }
734static void CU01(struct ge* ge) { SET_BIT(ge->future_state, 1); }
735static void CU02(struct ge* ge) { SET_BIT(ge->future_state, 2); }
736static void CU03(struct ge* ge) { SET_BIT(ge->future_state, 3); }
737static void CU04(struct ge* ge) { SET_BIT(ge->future_state, 4); }
738static void CU05(struct ge* ge) { SET_BIT(ge->future_state, 5); }
739static void CU06(struct ge* ge) { SET_BIT(ge->future_state, 6); }
740static void CU07(struct ge* ge) { SET_BIT(ge->future_state, 7); }
741
742/* Reset S0 */
743static void CU10(struct ge* ge) { RESET_BIT(ge->future_state, 0); }
744static void CU11(struct ge* ge) { RESET_BIT(ge->future_state, 1); }
745static void CU12(struct ge* ge) { RESET_BIT(ge->future_state, 2); }
746static void CU13(struct ge* ge) { RESET_BIT(ge->future_state, 3); }
747static void CU14(struct ge* ge) { RESET_BIT(ge->future_state, 4); }
748static void CU15(struct ge* ge) { RESET_BIT(ge->future_state, 5); }
749static void CU16(struct ge* ge) { RESET_BIT(ge->future_state, 6); }
750static void CU17(struct ge* ge) { RESET_BIT(ge->future_state, 7); }
751
752static void CU20(struct ge *ge) {
753 ge->rSO = ge->rSI = ge->future_state;
754 ge_log(LOG_FUTURE, "forcing state with CU20: %2x\n", ge->future_state);
755}
756
757
758/* Interrupt acknowledge. The nine interruption/LPSR states are per-clock
759 * charts now (msl-states.c, cp07 fo.22-31); this pseudo-command remains for
760 * the request handshake gemu abstracts: hardware re-entry is masked by the
761 * loaded FA06, while gemu's RINT is a test-driven flag that must drop once
762 * the interruption is taken. */
763static void INT_ACK(struct ge *ge) { ge->RINT = 0; }
Binary and decimal (unpacked) arithmetic helpers for the GE-120/130.
uint8_t ge_ua_decimal(uint8_t bo, uint8_t ro, int subtract, int one_digit, uint8_t *carry)
Arithmetic unit in decimal mode – one byte (two BCD digits), or one digit when CI50 restricts the uni...
Definition alu_dec.c:939
void alu_mvp(struct ge *ge, uint16_t a, uint8_t alen, uint16_t b, uint8_t blen)
MVP 0xE8 Move Packed: op1 = op2 (sign preserved from op2); CC set.
Definition alu_dec.c:616
void alu_sp(struct ge *ge, uint16_t a, uint8_t alen, uint16_t b, uint8_t blen)
SP 0xEB Subtract Packed: op1 = op1 - op2; CC set.
Definition alu_dec.c:326
void alu_upks(struct ge *ge, uint16_t dst, uint8_t dlen, uint16_t src, uint8_t slen)
UPKS 0xEF Unpack with Sign: packed op2 → zoned op1; zone always 0x4.
Definition alu_dec.c:806
void alu_upk(struct ge *ge, uint16_t dst, uint8_t dlen, uint16_t src, uint8_t slen)
UPK 0xD8 Unpack: packed op2 → zoned op1 (no sign processing; zone of each result byte is taken from t...
Definition alu_dec.c:730
void alu_pks(struct ge *ge, uint16_t dst, uint8_t dlen, uint16_t src, uint8_t slen)
PKS 0xEE Pack with Sign: zoned op2 → packed op1; sign from zone of rightmost source byte (zone 0xA → ...
Definition alu_dec.c:763
void alu_mp(struct ge *ge, uint16_t a, uint8_t alen, uint16_t b, uint8_t blen)
MP 0xEC Multiply Packed: op1 = op1 * op2; CC set.
Definition alu_dec.c:360
void alu_cmp(struct ge *ge, uint16_t a, uint8_t alen, uint16_t b, uint8_t blen)
CMP 0xE9 Compare Packed (algebraic, no operand change); CC set.
Definition alu_dec.c:561
void alu_pk(struct ge *ge, uint16_t dst, uint8_t dlen, uint16_t src, uint8_t slen)
PK 0xDA Pack: zoned op2 → packed op1 (no sign processing).
Definition alu_dec.c:684
void alu_edt(struct ge *ge, uint16_t pattern, uint8_t plen, uint16_t src)
EDT 0xDE Edit packed source into pattern at op1.
Definition alu_dec.c:870
void alu_ap(struct ge *ge, uint16_t a, uint8_t alen, uint16_t b, uint8_t blen)
AP 0xEA Add Packed: op1 = op1 + op2; CC set.
Definition alu_dec.c:255
void alu_dp(struct ge *ge, uint16_t a, uint8_t alen, uint16_t b, uint8_t blen)
DP 0xED Divide Packed: op1[left L1-L2 chars] = quotient, op1[right L2+1 chars] = remainder; CC set.
Definition alu_dec.c:461
GE-130 packed/signed decimal ALU helpers.
void alu_tr(struct ge *ge, uint16_t a, uint8_t len, uint16_t table)
alu_tr – Translate (TR, opcode 0xDC, §5.5.3.3)
Definition alu_logic.c:206
void alu_nc(struct ge *ge, uint16_t a, uint16_t b, uint8_t len)
alu_nc – AND Characters (NC, §5.5.3.9)
Definition alu_logic.c:61
void alu_oc(struct ge *ge, uint16_t a, uint16_t b, uint8_t len)
alu_oc – OR Characters (OC, §5.5.3.8)
Definition alu_logic.c:74
void alu_cmc(struct ge *ge, uint16_t a, uint16_t b, uint8_t len)
alu_cmc – Compare Characters (CMC, §5.5.3.2)
Definition alu_logic.c:156
void alu_xc(struct ge *ge, uint16_t a, uint16_t b, uint8_t len)
alu_xc – Exclusive-OR Characters (XC, §5.5.3.7)
Definition alu_logic.c:87
void alu_mvc(struct ge *ge, uint16_t dst, uint16_t src, uint16_t len)
alu_mvc – Move Characters (MVC, §5.5.3.1)
Definition alu_logic.c:31
GE-120/130 ALU logical and string-move primitives.
void alu_sr(struct ge *ge, uint16_t *r7, uint16_t field, uint16_t len, uint8_t model)
alu_sr - Search Right (SR, 0xD9)
Definition alu_reg.c:228
void alu_sl(struct ge *ge, uint16_t *r7, uint16_t field, uint16_t len, uint8_t model)
alu_sl - Search Left (SL, 0xDB)
Definition alu_reg.c:263
ALU helpers for GE-120/GE-130 register and memory-field operations.
Bit manipulation helpers.
#define BIT(V, X)
Definition bit.h:9
#define SET_BIT(R, X)
Definition bit.h:10
#define RESET_BIT(R, X)
Definition bit.h:11
void channel_accept_output(struct ge *ge, struct ge_channel *ch, uint8_t c)
Definition channel.c:31
void ge_mem_store8(struct ge *ge, uint16_t addr, uint8_t val)
Store a byte with generated odd parity + mark-written (for the hybrid ALU/SS write paths that write g...
Definition ge.c:317
@ NS_ZERO
Definition ge.h:105
@ NS_RO1
Definition ge.h:110
@ NS_UA1
Definition ge.h:113
@ NS_UA2
Definition ge.h:112
@ NS_RO2
Definition ge.h:111
static uint16_t NI_knot(struct ge *ge)
NI Knot.
Definition signals.h:362
static uint16_t NO_knot(struct ge *ge)
Knot driven by P0, V1, V2, V4, L1, R1, V3 and L3.
Definition signals.h:212
static uint16_t NE_knot(struct ge *ge)
NE Knot.
Definition signals.h:1130
void ge_log(ge_log_type type, const char *format,...)
Log message.
Definition log.c:122
@ LOG_ERR
Emulator unrecoverable condition.
Definition log.h:18
@ LOG_FUTURE
Future state network debug.
Definition log.h:24
@ LOG_PERI
Peripherals IO.
Definition log.h:27
static void CI73(struct ge *ge)
static void CE08(struct ge *ge)
static void CI02(struct ge *ge)
static uint16_t eff_v1_l2(struct ge *ge)
static void CI08(struct ge *ge)
static void CE01(struct ge *ge)
static void CU05(struct ge *ge)
static void CI63(struct ge *ge)
static void CI39(struct ge *ge)
static void CO49(struct ge *ge)
static void CO04(struct ge *ge)
static void CE11(struct ge *ge)
static void CO14(struct ge *ge)
static void CE18(struct ge *ge)
static void CI21(struct ge *ge)
static void CI20(struct ge *ge)
static void CO00(struct ge *ge)
static void CU12(struct ge *ge)
static void CI00s(struct ge *ge)
static void CI66(struct ge *ge)
static void CI19(struct ge *ge)
static void CE10(struct ge *ge)
static void CI74(struct ge *ge)
static void CI17(struct ge *ge)
static void CU00(struct ge *ge)
static void CO35(struct ge *ge)
static void CI50(struct ge *ge)
static void CI15(struct ge *ge)
static void CU06(struct ge *ge)
static void CE03(struct ge *ge)
static void CI70(struct ge *ge)
static void CU07(struct ge *ge)
static void CE00(struct ge *ge)
static void CO01(struct ge *ge)
static void CI11(struct ge *ge)
static void CU02(struct ge *ge)
static void CI06(struct ge *ge)
static void CI32(struct ge *ge)
static void CI65(struct ge *ge)
static void CO03(struct ge *ge)
static void NO_UNDRIVEN(struct ge *ge)
static void CI75(struct ge *ge)
static void CI42(struct ge *ge)
static void CU13(struct ge *ge)
static void CE07(struct ge *ge)
static void CI80(struct ge *ge)
static void CI07(struct ge *ge)
static void CI81(struct ge *ge)
static void CU17(struct ge *ge)
static void CO96(struct ge *ge)
static void CI60(struct ge *ge)
static void CI86(struct ge *ge)
static void CE06(struct ge *ge)
static void CO94(struct ge *ge)
static void CU20(struct ge *ge)
static void CO48(struct ge *ge)
static void CI64(struct ge *ge)
static void CI68(struct ge *ge)
static void CI10(struct ge *ge)
static void CE16(struct ge *ge)
static void CO91(struct ge *ge)
static void CI05(struct ge *ge)
static void CI82(struct ge *ge)
static void CE09(struct ge *ge)
static void CI84(struct ge *ge)
static uint16_t reg_addr_of(struct ge *ge)
static void CI72(struct ge *ge)
static void CU01(struct ge *ge)
static uint16_t mem_rd16_op(struct ge *ge, uint16_t a)
static void CO90(struct ge *ge)
static void CE02(struct ge *ge)
static void CI46(struct ge *ge)
static void CI04(struct ge *ge)
static void INT_ACK(struct ge *ge)
static void CI88(struct ge *ge)
static void CI45(struct ge *ge)
static void CI83(struct ge *ge)
static void CI41(struct ge *ge)
static void mem_wr16_op(struct ge *ge, uint16_t a, uint16_t v)
static void CO18(struct ge *ge)
static void CO40(struct ge *ge)
static void CI09(struct ge *ge)
static void CI89(struct ge *ge)
static void CU10(struct ge *ge)
static void CI62(struct ge *ge)
static void CI38(struct ge *ge)
static void CI69(struct ge *ge)
static void CI03(struct ge *ge)
static void CI77(struct ge *ge)
static void CU14(struct ge *ge)
static void CO11(struct ge *ge)
static void CU16(struct ge *ge)
static void CO12(struct ge *ge)
static void NI4_ZERO(struct ge *ge)
static void CI87(struct ge *ge)
static void CI85(struct ge *ge)
static void CI44(struct ge *ge)
static void CO97(struct ge *ge)
static void CO30(struct ge *ge)
static void CI67(struct ge *ge)
static void CO16(struct ge *ge)
static void CI40(struct ge *ge)
static void CI00(struct ge *ge)
static void CI33(struct ge *ge)
static void CO41(struct ge *ge)
static void CO92(struct ge *ge)
static void cr_wr16(struct ge *ge, uint16_t a, uint16_t v)
static void CO13(struct ge *ge)
static void CI61(struct ge *ge)
static void CO10(struct ge *ge)
static void CO31(struct ge *ge)
static void CE05(struct ge *ge)
static uint16_t cr_rd16(struct ge *ge, uint16_t a)
static void CU11(struct ge *ge)
static void EXEC_SS(struct ge *ge)
static void CI47(struct ge *ge)
static void CU03(struct ge *ge)
static void CE19(struct ge *ge)
static void CO93(struct ge *ge)
static void CI76(struct ge *ge)
static void CO95(struct ge *ge)
static void CE_chan1_status(struct ge *ge)
static void CI34(struct ge *ge)
static void CI16(struct ge *ge)
static void CI12(struct ge *ge)
static void CI78(struct ge *ge)
static void CI71(struct ge *ge)
static void CO02(struct ge *ge)
static void CU15(struct ge *ge)
static void CU04(struct ge *ge)
static void CI01(struct ge *ge)
#define SP_OPCODE
Definition opcodes.h:75
#define XC_OPCODE
Definition opcodes.h:65
#define NC_OPCODE
Definition opcodes.h:62
#define SL_OPCODE
Definition opcodes.h:69
#define CMP_OPCODE
Definition opcodes.h:73
#define MP_OPCODE
Definition opcodes.h:76
#define CMC_OPCODE
Definition opcodes.h:63
#define UPK_OPCODE
Definition opcodes.h:66
#define PKS_OPCODE
Definition opcodes.h:78
#define OC_OPCODE
Definition opcodes.h:64
#define DP_OPCODE
Definition opcodes.h:77
#define MVC_OPCODE
Definition opcodes.h:61
#define AP_OPCODE
Definition opcodes.h:74
#define EDT_OPCODE
Definition opcodes.h:71
#define PK_OPCODE
Definition opcodes.h:68
#define SR_OPCODE
Definition opcodes.h:67
#define MVP_OPCODE
Definition opcodes.h:72
#define TR_OPCODE
Definition opcodes.h:70
#define UPKS_OPCODE
Definition opcodes.h:79
void reader_send_tu10(struct ge *ge)
Definition reader.c:167
void connector_send_tu00(struct ge *ge, struct ge_connector *conn)
Definition reader.c:274
void reader_send_tu00(struct ge *ge)
Definition reader.c:43
Signals.
uint16_t ACON
Stops on jump condition not verified.
Definition console.h:113
uint16_t ACOV
Stops on jump condition verified.
Definition console.h:105
struct ge_counting_network::cmds cmds
struct cmds ci_cmds
Definition ge.h:57
enum knot_ni_source ni4
Definition ge.h:120
enum knot_ni_source ni2
Definition ge.h:118
enum knot_ni_source ni1
Definition ge.h:117
enum knot_ni_source ni3
Definition ge.h:119
uint8_t forcings
Definition ge.h:77
enum ge_knot_no::@1 force_mode
enum ge_knot_no::@2 cmd
uint8_t subtract_xor
Definition ge.h:66
uint8_t decimal_and
Definition ge.h:65
uint8_t logic
Definition ge.h:64
uint8_t low_zone_only
Definition ge.h:73
The entire state of the emulated system, including registers, memory, peripherals and timings.
Definition ge.h:172
uint8_t ALAM
Operator Call.
Definition ge.h:431
uint8_t RINT
Definition ge.h:493
uint8_t RT121
Definition ge.h:666
uint8_t rRA
Definition ge.h:334
uint8_t PB37
Definition ge.h:506
uint8_t rRE
Definition ge.h:333
uint8_t AINI
Program Loading.
Definition ge.h:377
struct ge_connector ST4
The I/O interface for the ST4 connector.
Definition ge.h:785
uint8_t ALTO
Stops internal cycles.
Definition ge.h:392
uint16_t rPO
Program addresser.
Definition ge.h:191
uint8_t PIC1
Selection Channel 1.
Definition ge.h:526
uint8_t future_state
Future state.
Definition ge.h:675
uint8_t PODI
Slow delay line.
Definition ge.h:400
uint8_t inject_chan1_status
Channel-1 peripheral status override for error injection.
Definition ge.h:736
uint16_t rV1
Addresser for the first operand.
Definition ge.h:201
uint8_t rSO
Main sequencer.
Definition ge.h:309
uint16_t rRO
Multipurpose 8+1 bit register.
Definition ge.h:248
struct ge_counting_network counting_network
Definition ge.h:738
struct ge_console_switches console_switches
The current state of the console switches.
Definition ge.h:685
struct ge_connector ST3
The I/O interface for the ST3 connector.
Definition ge.h:780
uint8_t rL2
Auxiliary register.
Definition ge.h:232
uint8_t ffFI
Special conditions register 1.
Definition ge.h:342
uint8_t RC00
Asynchronous CPU Cycle Request.
Definition ge.h:574
uint8_t rRI
Photoprint register 8-bit register used to store the photodisc codes.
Definition ge.h:223
uint16_t rBO
Default operator.
Definition ge.h:277
uint8_t PB06
Unconditionally stores L106.
Definition ge.h:502
uint8_t RC01
Asynchronous Channel 1 Cycle Request.
Definition ge.h:587
enum ge::@3 memory_command
struct ge_ua_controls ua_controls
Definition ge.h:739
struct ge_knot_ni kNI
Knot driven by counting network, or by the UA to store the result of the operation.
Definition ge.h:241
uint8_t mem[MEM_SIZE]
The memory of the emulated system.
Definition ge.h:695
uint8_t AVER
Jump Condition Verified.
Definition ge.h:442
struct ge_channel channel2
Integrated channel 2 (CAN2) line bundle — shared by the integrated reader (input),...
Definition ge.h:794
uint8_t RAVI
VICU Support.
Definition ge.h:664
uint8_t RACI
Rejected Command.
Definition ge.h:661
uint8_t RT131
Definition ge.h:667
uint16_t rV4
Addresser for external instructions using channel 2.
Definition ge.h:204
uint8_t RASI
Channel 1 in transfer.
Definition ge.h:533
uint16_t rL1
Length of the operand.
Definition ge.h:231
uint16_t rV2
Addresser for the second operand.
Definition ge.h:202
uint8_t RC02
Asynchronous Channel 2 Cycle Request.
Definition ge.h:602
uint8_t ADIR
Disable Step By Step.
Definition ge.h:456
uint8_t RIG1
End from controller 1.
Definition ge.h:656
uint8_t rSI
Peripheral unit sequencer.
Definition ge.h:323
uint8_t URPU
Definition ge.h:555
uint8_t RC03
Asynchronous Channel 3 Cycle Request.
Definition ge.h:617
enum clock current_clock
Definition ge.h:174
uint8_t PB26
Stores L106 if channel 2 is selected.
Definition ge.h:504
uint16_t rL3
Length of operands involving channel 3.
Definition ge.h:233
uint8_t rUA
UA (arithmetic unit) output latch.
Definition ge.h:260
uint8_t PB07
Unconditionally stores L106.
Definition ge.h:503
uint8_t RETO
Definition ge.h:358
uint8_t URPE
Definition ge.h:554
uint16_t rV3
Addresser for external instructions using channel 3.
Definition ge.h:203
uint8_t TO50_did_CI32_or_CI33
Workaround for pulse TO50.
Definition ge.h:816
uint8_t PB36
Definition ge.h:505
struct ge_knot_no kNO
Definition ge.h:235
uint8_t rFO
Current function code.
Definition ge.h:284
uint16_t cr_cache[8]
Change/segment-register cache (kept in sync by the register instructions via cr_wr16 and by ge_seed_s...
Definition ge.h:217