17#define SIG( name ) static inline uint8_t name (struct ge *ge)
26SIG(RESIA) {
return !RESI1(
ge); }
31SIG(RIUCA) {
return !(RIA01(
ge) && RESIA(
ge) && RIA2A(
ge) && RIA3A(
ge)); }
34SIG(RES01) {
return !(RESIA(
ge) ); }
75SIG(verified_condition) {
78 uint8_t M7 =
BIT(M, 7);
79 uint8_t M6 =
BIT(M, 6);
80 uint8_t M5 =
BIT(M, 5);
81 uint8_t M4 =
BIT(M, 4);
88 ((M7 && !FA4 && !FA5) ||
89 (M6 && !FA4 && FA5) ||
90 (M5 && FA4 && !FA5) ||
91 (M4 && FA4 && FA5))) ||
170 if (c->from_zero && c->from_04) {
171 uint8_t lo =
ge->
rBO & 0x0f;
172 uint8_t hi = (
ge->
rBO >> 4) & 0x0f;
175 lo = (lo - 1) & 0x0f;
176 hi = (hi - 1) & 0x0f;
178 lo = (lo + 1) & 0x0f;
179 hi = (hi + 1) & 0x0f;
181 return (
ge->
rBO & 0xff00) | (uint16_t)(hi << 4) | lo;
192 return (
ge->
rBO & 0xff00) | ((
ge->
rBO - delta) & 0x00ff);
193 return ge->
rBO - delta;
196 return (
ge->
rBO & 0xff00) | ((
ge->
rBO + delta) & 0x00ff);
197 return ge->
rBO + delta;
244 case KNOT_RI_IN_NO_43:
247 case KNOT_NONE_IN_NO:
253 case KNOT_FORCING_NONE:
255 case KNOT_FORCING_NO_21:
266 case KNOT_FORCING_NO_43:
301 if (RES0(
ge) || (RIUC(
ge) && AF32(
ge)))
307 if (RES0(
ge) || RES3(
ge))
310 if (RIUC(
ge) && !AF32(
ge))
323 return (cn & 0x000f) >> 0;
325 return (cn & 0x00f0) >> 4;
327 return (cn & 0x0f00) >> 8;
329 return (cn & 0xf000) >> 12;
331 return (
ge->
rRO & 0x0f) >> 0;
333 return (
ge->
rRO & 0xf0) >> 4;
335 return (
ge->
rUA & 0xf0) >> 4;
337 return (
ge->
rUA & 0x0f) >> 0;
368 return ((ni4 << 12) |
457SIG(DI79A) {
return !(DI151(
ge) && DI021(
ge)); }
468SIG(DI84A) {
return !(DI011(
ge) && DI291(
ge)); }
469SIG(DI85A) {
return !(DI291(
ge) && DI031(
ge)); }
472SIG(DI91A) {
return !(DI031(
ge) && DI211(
ge)); }
473SIG(DI931) {
return !(DI21A(
ge) && DI29A(
ge) && DI21A(
ge) && DI15A(
ge)); }
476SIG(DI95A) {
return !(DI931(
ge) && DI031(
ge)); }
477SIG(DI971) {
return !(DI29A(
ge) && DI25A(
ge) && DI24A(
ge) && DI29A(
ge)); }
483SIG(DO021) {
return !(DO02A(
ge) && DO02A(
ge)); }
533 case 466:
return 6000;
534 case 467:
return 4000;
535 default:
return 2000;
618 uint8_t b12 = !!(addr & 0x1000), b13 = !!(addr & 0x2000),
619 b14 = !!(addr & 0x4000);
620 uint8_t A = VAMA1(
ge), B = VAMB1(
ge), C = VAMC1(
ge);
622 if (b13 && A && B && C)
return 0;
623 if (b14 && A)
return 0;
624 if (b13 && b12 && B)
return 0;
625 if (b14 && b13 && C)
return 0;
637 for (uint32_t a = 0x1000; a < 0x8000; a += 0x1000)
639 return (uint16_t)(a >> 10);
702SIG(UCOA1) {
return !(CI46B(
ge) && CI47B(
ge)); }
703SIG(UCO21) {
return !(CI45D(
ge) && UCOA1(
ge)); }
705SIG(UCO4A) {
return !(CI451(
ge) && CI471(
ge)); }
707SIG(UCO0A) {
return !(CI45D(
ge) && CI461(
ge) && CI47B(
ge)); }
709SIG(UCO1A) {
return !(CI45D(
ge) && CI471(
ge)); }
715SIG(UZE71_enabled) {
return CI50B(
ge); }
716SIG(UZE81_enabled) {
return CI50B(
ge); }
751SIG(DE00A) {
return !(DO011(
ge) && DI062(
ge)); }
752SIG(DE06A) {
return !(DO021(
ge) && DI062(
ge)); }
753SIG(DE11A) {
return !(DI061(
ge) && DO001(
ge)); }
754SIG(DE13A) {
return !(DO061(
ge) && DI061(
ge)); }
762 return !(DE00A(
ge) && DE06A(
ge) && DE11A(
ge) && DE13A(
ge));
767SIG(DE07A) {
return !(DO071(
ge) && DI062(
ge)); }
769SIG(DE231) {
return !(DE23A(
ge) && DE23A(
ge)); }
771SIG(DA25A) {
return !(DI111(
ge) && DO021(
ge)); }
777SIG(DU201) {
return !(DU18A(
ge) && DU19A(
ge)); }
780SIG(EC70A) {
return !(AF51(
ge) && DI572(
ge)); }
784SIG(ED91A) {
return !(DE231(
ge) && DU201(
ge)); }
894SIG(PB11A) {
return !(FINA1(
ge) && PC111(
ge)); }
895SIG(PB13A) {
return !(TE303(
ge) && PC131(
ge)); }
896SIG(PB14A) {
return !(TE304(
ge) && PC141(
ge)); }
901SIG(RB101) {
return !(AITEA(
ge) && PB11A(
ge) && PB13A(
ge) && PB14A(
ge)); }
904SIG(RB01A) {
return !(RT121(
ge) && RB101(
ge)); }
905SIG(RB111) {
return !(RB12A(
ge) && RB01A(
ge)); }
907SIG(PF12A) {
return !(FINI1(
ge) && PC121(
ge)); }
908SIG(PF13A) {
return !(FINE3(
ge) && PC131(
ge)); }
909SIG(PF14A) {
return !(FINE4(
ge) && PC141(
ge)); }
910SIG(RF101) {
return !(PF12A(
ge) && PF13A(
ge) && PF14A(
ge)); }
933SIG(PELEA) {
return !(LU081(
ge) && LUPO1(
ge)); }
934SIG(RELO1) {
return !(PELEA(
ge) && RUF1A(
ge)); }
935SIG(PAM4A) {
return !(RELO1(
ge) && RASI1(
ge) && PC121(
ge)); }
936SIG(PM11A) {
return !(FUSE1(
ge) && PC111(
ge)); }
937SIG(PM13A) {
return !(MARE3(
ge) && PC131(
ge)); }
938SIG(PM14A) {
return !(MARE4(
ge) && PC141(
ge)); }
939SIG(RM101) {
return !(PM11A(
ge) && PM13A(
ge) && PM14A(
ge)); }
940SIG(PAM1A) {
return !(RASI1(
ge) && RM101(
ge)); }
941SIG(RS011) {
return !(PAM4A(
ge) && PAM1A(
ge)); }
942SIG(PIM1A) {
return !(TO501(
ge) || RS011(
ge) || RB111(
ge) || RUF11(
ge)); }
945SIG(PUC11) {
return !(PIC1A(
ge) && PIM1A(
ge)); }
986SIG(PC11A) {
return !(PUC11(
ge) && PB071(
ge) && PB061(
ge)); }
987SIG(PC12A) {
return !(PUC11(
ge) && PB071(
ge) && PB06A(
ge)); }
988SIG(PC13A) {
return !(PUC11(
ge) && PB07A(
ge) && PB06A(
ge)); }
989SIG(PC14A) {
return !(PUC11(
ge) && PB07A(
ge) && PB061(
ge)); }
990SIG(PC21A) {
return !(PUC21(
ge) && PB261(
ge)); }
991SIG(PC22A) {
return !(PUC21(
ge) && PB26A(
ge)); }
992SIG(PC31A) {
return !(PUC31(
ge) && PB371(
ge) && PB361(
ge)); }
993SIG(PC32A) {
return !(PUC31(
ge) && PB371(
ge) && PB36A(
ge)); }
994SIG(PC33A) {
return !(PUC31(
ge) && PB37A(
ge) && PB36A(
ge)); }
995SIG(PC34A) {
return !(PUC31(
ge) && PB37A(
ge) && PB361(
ge)); }
997SIG(SEPEI) {
return !(PC11A(
ge) && PC21A(
ge) && PC31A(
ge)); }
998SIG(PU002) {
return !(PC12A(
ge) && PC22A(
ge) && PC32A(
ge)); }
999SIG(PU003) {
return !(PC13A(
ge) && PC33A(
ge)); }
1008SIG(PUB01) {
return !(PUB01_d1(
ge) && PUB01_d2(
ge) && PUB01_d3(
ge) && PUB01_d4(
ge)); }
1025SIG(DU89A) {
return !(DU871(
ge) && DU881(
ge) && PC011(
ge) && DU881(
ge)); }
1076SIG(RA101) {
return !(PA11A(
ge) && PA12A(
ge) && PA13A(
ge) && PA13A(
ge) && PA14A(
ge)); }
1112SIG(PIB21) {
return !(PB12A(
ge) && PB22A(
ge) && PB32A(
ge)); }
1132 const char *where =
"";
1134 uint8_t count = PIB11(
ge) + PIB21(
ge) + PIB31(
ge) + PIB41(
ge);
1160 ge_log(
LOG_PERI,
"READING FROM NE KNOT %s --> %03x\n", where, ret);
1174#define NAOR(a, b, c, d) !(a || b || c || d)
Bit manipulation helpers.
static uint16_t NI_knot(struct ge *ge)
NI Knot.
static uint8_t NI_source(struct ge *ge, enum knot_ni_source source)
static uint16_t NO_knot(struct ge *ge)
Knot driven by P0, V1, V2, V4, L1, R1, V3 and L3.
static uint8_t NA_knot(struct ge *ge)
Knot driven by SO or SI.
static uint16_t ge_memory_capacity_k(struct ge *ge)
static uint16_t ge_cycle_period_ns(const struct ge *ge)
Cycle period in nanoseconds for the strapped version.
static uint8_t ge_mem_in_bounds(struct ge *ge, uint16_t addr)
Installed memory, in K.
static uint16_t ge_cpu_version_uce(const struct ge *ge)
Processor version: 466, 467 or 468 (cp06 ch.002 TAB.1).
static uint16_t NE_knot(struct ge *ge)
NE Knot.
void ge_log(ge_log_type type, const char *format,...)
Log message.
@ LOG_PERI
Peripherals IO.
uint8_t reader_get_LUPO1(struct ge *ge)
uint8_t connector_get_TE30(struct ge_connector *conn)
uint8_t reader_get_LU08(struct ge *ge)
uint8_t connector_get_MARE(struct ge_connector *conn)
uint8_t reader_get_FINI1(struct ge *ge)
uint8_t connector_get_TE10(struct ge_connector *conn)
uint8_t connector_get_TE20(struct ge_connector *conn)
uint8_t connector_get_FINE(struct ge_connector *conn)
static uint16_t ge_counting_network_output(struct ge *ge)
uint16_t SITE
Don't wait for external unit availability.
struct ge_counting_network::cmds cmds
enum ge_knot_no::@1 force_mode
enum ge_pont E03
E03: machine version, paired with F04 (TAB.1) – FEL06 / FEL16.
enum ge_pont F03
F03: which connectors may raise an interruption (TAB.2).
enum ge_pont E04
E04: which two connectors are enabled for the initial LOAD (TAB.3).
uint8_t S42_diag
S42 "LAMPS" on the maintenance panel, in position DIAG.
enum ge_pont E05
E05 / F05: memory capacity (cp06 ch.001, "SELEZIONE CAPACITA MEMORIA") – 8K through 32K.
enum ge_pont F04
F04: machine version straps – cycle period and performance (TAB.1).
The entire state of the emulated system, including registers, memory, peripherals and timings.
uint8_t RET2
Channel-2 cycle-assignment memory.
uint8_t AINI
Program Loading.
struct ge_integrated_reader integrated_reader
The I/O interface for the integrated reader (RI)
uint8_t JS2
Console jump condition 2.
struct ge_connector ST4
The I/O interface for the ST4 connector.
uint8_t ffFA
Special conditions register 2.
uint16_t rPO
Program addresser.
uint8_t PIC1
Selection Channel 1.
enum ge_console_rotary register_selector
The current state of the console register rotary switch.
uint8_t RIA0
Synchronous CPU Cycle Request.
uint8_t RIA2
Synchronous Channel 2 Cycle Request.
uint16_t rV1
Addresser for the first operand.
uint8_t rSO
Main sequencer.
uint16_t rRO
Multipurpose 8+1 bit register.
struct ge_counting_network counting_network
struct ge_console_switches console_switches
The current state of the console switches.
struct ge_connector ST3
The I/O interface for the ST3 connector.
uint8_t RIA3
Synchronous Channel 3 Cycle Request.
uint8_t PUC3
Channel 3 in transfer.
uint8_t rL2
Auxiliary register.
uint8_t PUC2
Channel 2 in transfer.
uint8_t rRI
Photoprint register 8-bit register used to store the photodisc codes.
uint16_t rBO
Default operator.
uint8_t PB06
Unconditionally stores L106.
struct ge_ua_controls ua_controls
struct ge_knot_ni kNI
Knot driven by counting network, or by the UA to store the result of the operation.
uint8_t RACI
Rejected Command.
uint16_t rV4
Addresser for external instructions using channel 2.
uint8_t RASI
Channel 1 in transfer.
uint16_t rL1
Length of the operand.
uint8_t rSA
Future state configuration.
uint16_t rV2
Addresser for the second operand.
uint8_t RESI
Synchronous Channel 1 Cycle Request.
struct ge_options options
Backplane straps and maintenance-panel options (cp06 ch.002).
uint8_t RIG1
End from controller 1.
uint8_t rSI
Peripheral unit sequencer.
uint8_t PB26
Stores L106 if channel 2 is selected.
uint16_t rL3
Length of operands involving channel 3.
uint8_t rUA
UA (arithmetic unit) output latch.
uint8_t PB07
Unconditionally stores L106.
uint16_t rV3
Addresser for external instructions using channel 3.
uint8_t rFO
Current function code.
uint8_t JS1
Console jump condition 1.