aboutsummaryrefslogtreecommitdiffstats
path: root/emulators/simh
diff options
context:
space:
mode:
authormatthew <matthew@FreeBSD.org>2017-01-03 22:00:47 +0800
committermatthew <matthew@FreeBSD.org>2017-01-03 22:00:47 +0800
commit72b059e11114706bd706bcd0dd48171f18c9e8a3 (patch)
tree0752b4ea3e6f7dda7f1a2ab4235d6bffb9455613 /emulators/simh
parentfe9cd7e22b54b5f82cc9af5c4f43cae39750678d (diff)
downloadfreebsd-ports-gnome-72b059e11114706bd706bcd0dd48171f18c9e8a3.tar.gz
freebsd-ports-gnome-72b059e11114706bd706bcd0dd48171f18c9e8a3.tar.zst
freebsd-ports-gnome-72b059e11114706bd706bcd0dd48171f18c9e8a3.zip
Fixes to allow building on 12-CURRENT
- fix build failures in i386 and amd64 due to compiler changes - fix numerous compilation warnings and logical errors that may trap in the future - convert all distribution files from DOS format to ease future changes - convert legacy patch file to new naming convention PR: 214990 Submitted by: bob@eager.cx (maintainer)
Diffstat (limited to 'emulators/simh')
-rw-r--r--emulators/simh/Makefile5
-rw-r--r--emulators/simh/files/patch-ALTAIR_altair__cpu.c20
-rw-r--r--emulators/simh/files/patch-GRI_gri__cpu.c11
-rw-r--r--emulators/simh/files/patch-H316_h316__cpu.c203
-rw-r--r--emulators/simh/files/patch-H316_h316__dp.c56
-rw-r--r--emulators/simh/files/patch-H316_h316__mt.c32
-rw-r--r--emulators/simh/files/patch-H316_h316__stddev.c11
-rw-r--r--emulators/simh/files/patch-H316_h316__sys.c16
-rw-r--r--emulators/simh/files/patch-HP2100_hp2100__baci.c50
-rw-r--r--emulators/simh/files/patch-HP2100_hp2100__cpu.c89
-rw-r--r--emulators/simh/files/patch-HP2100_hp2100__cpu0.c20
-rw-r--r--emulators/simh/files/patch-HP2100_hp2100__cpu1.c63
-rw-r--r--emulators/simh/files/patch-HP2100_hp2100__cpu2.c29
-rw-r--r--emulators/simh/files/patch-HP2100_hp2100__cpu3.c56
-rw-r--r--emulators/simh/files/patch-HP2100_hp2100__cpu4.c20
-rw-r--r--emulators/simh/files/patch-HP2100_hp2100__cpu5.c20
-rw-r--r--emulators/simh/files/patch-HP2100_hp2100__cpu6.c29
-rw-r--r--emulators/simh/files/patch-HP2100_hp2100__cpu7.c20
-rw-r--r--emulators/simh/files/patch-HP2100_hp2100__di.c76
-rw-r--r--emulators/simh/files/patch-HP2100_hp2100__di__da.c60
-rw-r--r--emulators/simh/files/patch-HP2100_hp2100__dp.c39
-rw-r--r--emulators/simh/files/patch-HP2100_hp2100__dq.c39
-rw-r--r--emulators/simh/files/patch-HP2100_hp2100__fp1.c17
-rw-r--r--emulators/simh/files/patch-HP2100_hp2100__ipl.c11
-rw-r--r--emulators/simh/files/patch-HP2100_hp2100__lps.c16
-rw-r--r--emulators/simh/files/patch-HP2100_hp2100__mpx.c70
-rw-r--r--emulators/simh/files/patch-HP2100_hp2100__ms.c72
-rw-r--r--emulators/simh/files/patch-HP2100_hp2100__mt.c44
-rw-r--r--emulators/simh/files/patch-HP2100_hp2100__mux.c30
-rw-r--r--emulators/simh/files/patch-HP2100_hp2100__stddev.c25
-rw-r--r--emulators/simh/files/patch-HP2100_hp2100__sys.c16
-rw-r--r--emulators/simh/files/patch-HP2100_hp__disclib.c69
-rw-r--r--emulators/simh/files/patch-I1401_i1401__cd.c11
-rw-r--r--emulators/simh/files/patch-I1401_i1401__cpu.c104
-rw-r--r--emulators/simh/files/patch-I1401_i1401__dp.c60
-rw-r--r--emulators/simh/files/patch-I1401_i1401__mt.c11
-rw-r--r--emulators/simh/files/patch-I1620_i1620__cpu.c11
-rw-r--r--emulators/simh/files/patch-I1620_i1620__dp.c50
-rw-r--r--emulators/simh/files/patch-I1620_i1620__sys.c11
-rw-r--r--emulators/simh/files/patch-I1620_i1620__tty.c11
-rw-r--r--emulators/simh/files/patch-I7094_i7094__com.c11
-rw-r--r--emulators/simh/files/patch-I7094_i7094__cpu.c44
-rw-r--r--emulators/simh/files/patch-I7094_i7094__dsk.c55
-rw-r--r--emulators/simh/files/patch-I7094_i7094__io.c99
-rw-r--r--emulators/simh/files/patch-I7094_i7094__mt.c20
-rw-r--r--emulators/simh/files/patch-Ibm1130_ibm1130__cpu.c33
-rw-r--r--emulators/simh/files/patch-Interdata_id16__cpu.c11
-rw-r--r--emulators/simh/files/patch-Interdata_id32__cpu.c11
-rw-r--r--emulators/simh/files/patch-Interdata_id__dp.c20
-rw-r--r--emulators/simh/files/patch-Interdata_id__idc.c20
-rw-r--r--emulators/simh/files/patch-Interdata_id__io.c29
-rw-r--r--emulators/simh/files/patch-Interdata_id__mt.c27
-rw-r--r--emulators/simh/files/patch-Interdata_id__pas.c11
-rw-r--r--emulators/simh/files/patch-LGP_lgp__cpu.c29
-rw-r--r--emulators/simh/files/patch-LGP_lgp__stddev.c29
-rw-r--r--emulators/simh/files/patch-LGP_lgp__sys.c20
-rw-r--r--emulators/simh/files/patch-NOVA_eclipse__cpu.c11
-rw-r--r--emulators/simh/files/patch-NOVA_nova__cpu.c16
-rw-r--r--emulators/simh/files/patch-NOVA_nova__dkp.c20
-rw-r--r--emulators/simh/files/patch-NOVA_nova__mta.c38
-rw-r--r--emulators/simh/files/patch-NOVA_nova__qty.c33
-rw-r--r--emulators/simh/files/patch-NOVA_nova__tt1.c11
-rw-r--r--emulators/simh/files/patch-PDP10_pdp10__cpu.c29
-rw-r--r--emulators/simh/files/patch-PDP10_pdp10__ksio.c20
-rw-r--r--emulators/simh/files/patch-PDP10_pdp10__lp20.c20
-rw-r--r--emulators/simh/files/patch-PDP10_pdp10__mdfp.c11
-rw-r--r--emulators/simh/files/patch-PDP10_pdp10__rp.c11
-rw-r--r--emulators/simh/files/patch-PDP10_pdp10__tu.c56
-rw-r--r--emulators/simh/files/patch-PDP11_pdp11__cis.c38
-rw-r--r--emulators/simh/files/patch-PDP11_pdp11__cpu.c11
-rw-r--r--emulators/simh/files/patch-PDP11_pdp11__cpumod.c11
-rw-r--r--emulators/simh/files/patch-PDP11_pdp11__dl.c11
-rw-r--r--emulators/simh/files/patch-PDP11_pdp11__fp.c11
-rw-r--r--emulators/simh/files/patch-PDP11_pdp11__hk.c36
-rw-r--r--emulators/simh/files/patch-PDP11_pdp11__io.c23
-rw-r--r--emulators/simh/files/patch-PDP11_pdp11__ke.c20
-rw-r--r--emulators/simh/files/patch-PDP11_pdp11__rk.c45
-rw-r--r--emulators/simh/files/patch-PDP11_pdp11__rq.c140
-rw-r--r--emulators/simh/files/patch-PDP11_pdp11__sys.c12
-rw-r--r--emulators/simh/files/patch-PDP11_pdp11__ta.c36
-rw-r--r--emulators/simh/files/patch-PDP11_pdp11__tm.c53
-rw-r--r--emulators/simh/files/patch-PDP11_pdp11__tq.c176
-rw-r--r--emulators/simh/files/patch-PDP11_pdp11__ts.c38
-rw-r--r--emulators/simh/files/patch-PDP11_pdp11__tu.c56
-rw-r--r--emulators/simh/files/patch-PDP11_pdp11__xq.c39
-rw-r--r--emulators/simh/files/patch-PDP18B_pdp18b__cpu.c11
-rw-r--r--emulators/simh/files/patch-PDP18B_pdp18b__fpp.c111
-rw-r--r--emulators/simh/files/patch-PDP18B_pdp18b__mt.c38
-rw-r--r--emulators/simh/files/patch-PDP18B_pdp18b__stddev.c11
-rw-r--r--emulators/simh/files/patch-PDP18B_pdp18b__sys.c11
-rw-r--r--emulators/simh/files/patch-PDP18B_pdp18b__tt1.c11
-rw-r--r--emulators/simh/files/patch-PDP1_pdp1__cpu.c302
-rw-r--r--emulators/simh/files/patch-PDP1_pdp1__dcs.c11
-rw-r--r--emulators/simh/files/patch-PDP8_pdp8__cpu.c11
-rw-r--r--emulators/simh/files/patch-PDP8_pdp8__ct.c38
-rw-r--r--emulators/simh/files/patch-PDP8_pdp8__mt.c37
-rw-r--r--emulators/simh/files/patch-PDP8_pdp8__ttx.c11
-rw-r--r--emulators/simh/files/patch-S3_s3__cd.c11
-rw-r--r--emulators/simh/files/patch-S3_s3__cpu.c11
-rw-r--r--emulators/simh/files/patch-S3_s3__disk.c47
-rw-r--r--emulators/simh/files/patch-SDS_sds__cpu.c533
-rw-r--r--emulators/simh/files/patch-SDS_sds__dsk.c20
-rw-r--r--emulators/simh/files/patch-SDS_sds__io.c20
-rw-r--r--emulators/simh/files/patch-SDS_sds__lp.c11
-rw-r--r--emulators/simh/files/patch-SDS_sds__mt.c19
-rw-r--r--emulators/simh/files/patch-SDS_sds__mux.c11
-rw-r--r--emulators/simh/files/patch-SDS_sds__stddev.c11
-rw-r--r--emulators/simh/files/patch-VAX-vax_sysdev.c19
-rw-r--r--emulators/simh/files/patch-VAX_vax780__sbi.c30
-rw-r--r--emulators/simh/files/patch-VAX_vax__cis.c29
-rw-r--r--emulators/simh/files/patch-VAX_vax__cmode.c11
-rw-r--r--emulators/simh/files/patch-VAX_vax__cpu.c20
-rw-r--r--emulators/simh/files/patch-VAX_vax__io.c11
-rw-r--r--emulators/simh/files/patch-VAX_vax__octa.c20
-rw-r--r--emulators/simh/files/patch-VAX_vax__sys.c11
-rw-r--r--emulators/simh/files/patch-VAX_vax__sysdev.c19
-rw-r--r--emulators/simh/files/patch-makefile61
-rw-r--r--emulators/simh/files/patch-scp.c196
-rw-r--r--emulators/simh/files/patch-sim__console.c33
-rw-r--r--emulators/simh/files/patch-sim__ether.c43
-rw-r--r--emulators/simh/files/patch-sim__tape.c20
-rw-r--r--emulators/simh/files/patch-swtp6800_common_bootrom.c11
-rw-r--r--emulators/simh/files/patch-swtp6800_common_m6800.c37
123 files changed, 4941 insertions, 31 deletions
diff --git a/emulators/simh/Makefile b/emulators/simh/Makefile
index 189b05e9273e..981862309570 100644
--- a/emulators/simh/Makefile
+++ b/emulators/simh/Makefile
@@ -3,6 +3,7 @@
PORTNAME= simh
PORTVERSION= 3.9.0
+PORTREVISION= 1
CATEGORIES= emulators
MASTER_SITES= http://simh.trailing-edge.com/sources/
DISTNAME= ${PORTNAME}v${PORTVERSION:R:S/.//}-${PORTVERSION:E}
@@ -10,10 +11,12 @@ DISTNAME= ${PORTNAME}v${PORTVERSION:R:S/.//}-${PORTVERSION:E}
MAINTAINER= bob@eager.cx
COMMENT= Emulates classic DEC, HP, GRI, IBM, Altair, SDS, Honeywell, and others
+LICENSE= BSD3CLAUSE
+
NO_WRKSUBDIR= yes
USES= gmake dos2unix zip
-DOS2UNIX_FILES= makefile VAX/vax_sysdev.c
+CFLAGS+= -Wno-format-extra-args -Wno-comment -Wno-logical-op-parentheses -Wno-bitwise-op-parentheses
MAKE_ENV= GCC="${CC}" CFLAGS_O="${CFLAGS}" USE_NETWORK=1
MAKEFILE= makefile
diff --git a/emulators/simh/files/patch-ALTAIR_altair__cpu.c b/emulators/simh/files/patch-ALTAIR_altair__cpu.c
new file mode 100644
index 000000000000..8d0eceae3ee3
--- /dev/null
+++ b/emulators/simh/files/patch-ALTAIR_altair__cpu.c
@@ -0,0 +1,20 @@
+--- ALTAIR/altair_cpu.c.orig 2016-12-01 22:43:42 UTC
++++ ALTAIR/altair_cpu.c
+@@ -313,7 +313,7 @@ int32 sim_instr (void)
+
+ while (reason == 0) { /* loop until halted */
+ if (sim_interval <= 0) { /* check clock queue */
+- if (reason = sim_process_event ()) break;
++ if ((reason = sim_process_event ())) break;
+ }
+
+ if (int_req > 0) { /* interrupt? */
+@@ -366,7 +366,7 @@ int32 sim_instr (void)
+ if ((OP & 0xCF) == 0x01) { /* LXI */
+ DAR = M[PC] & 0x00ff;
+ PC++;
+- DAR = DAR | (M[PC] <<8) & 0xFF00;;
++ DAR = DAR | ((M[PC] <<8) & 0xFF00);
+ putpair((OP >> 4) & 0x03, DAR);
+ PC++;
+ continue;
diff --git a/emulators/simh/files/patch-GRI_gri__cpu.c b/emulators/simh/files/patch-GRI_gri__cpu.c
new file mode 100644
index 000000000000..e3cc2e1fce08
--- /dev/null
+++ b/emulators/simh/files/patch-GRI_gri__cpu.c
@@ -0,0 +1,11 @@
+--- GRI/gri_cpu.c.orig 2016-12-01 22:43:42 UTC
++++ GRI/gri_cpu.c
+@@ -421,7 +421,7 @@ ao_update ();
+ while (reason == 0) { /* loop until halted */
+
+ if (sim_interval <= 0) { /* check clock queue */
+- if (reason = sim_process_event ())
++ if ((reason = sim_process_event ()))
+ break;
+ }
+
diff --git a/emulators/simh/files/patch-H316_h316__cpu.c b/emulators/simh/files/patch-H316_h316__cpu.c
new file mode 100644
index 000000000000..9beaa5d45b59
--- /dev/null
+++ b/emulators/simh/files/patch-H316_h316__cpu.c
@@ -0,0 +1,203 @@
+--- H316/h316_cpu.c.orig 2016-12-01 22:43:42 UTC
++++ H316/h316_cpu.c
+@@ -424,7 +424,7 @@ reason = 0;
+ while (reason == 0) { /* loop until halted */
+
+ if (sim_interval <= 0) { /* check clock queue */
+- if (reason = sim_process_event ())
++ if ((reason = sim_process_event ()))
+ break;
+ }
+
+@@ -458,7 +458,7 @@ if (chan_req) {
+ t = iotab[dev] (ioOTA, 0, Read (ad), dev); /* output word */
+ if ((t & IOT_SKIP) == 0)
+ return STOP_DMAER;
+- if (r = (t >> IOT_V_REASON))
++ if ((r = (t >> IOT_V_REASON)))
+ return r;
+ }
+ if (Q_DMA (i)) { /* DMA? */
+@@ -528,7 +528,7 @@ if (hst_lnt) {
+ switch (I_GETOP (MB)) { /* case on <1:6> */
+
+ case 001: case 021: case 041: case 061: /* JMP */
+- if (reason = Ea (MB, &Y)) /* eff addr */
++ if ((reason = Ea (MB, &Y))) /* eff addr */
+ break;
+ PCQ_ENTRY; /* save PC */
+ PC = NEWA (PC, Y); /* set new PC */
+@@ -537,7 +537,7 @@ switch (I_GETOP (MB)) {
+ break;
+
+ case 002: case 022: case 042: case 062: /* LDA */
+- if (reason = Ea (MB, &Y)) /* eff addr */
++ if ((reason = Ea (MB, &Y))) /* eff addr */
+ break;
+ if (dp) { /* double prec? */
+ AR = Read (Y & ~1); /* get doubleword */
+@@ -548,13 +548,13 @@ switch (I_GETOP (MB)) {
+ break;
+
+ case 003: case 023: case 043: case 063: /* ANA */
+- if (reason = Ea (MB, &Y)) /* eff addr */
++ if ((reason = Ea (MB, &Y))) /* eff addr */
+ break;
+ AR = AR & Read (Y);
+ break;
+
+ case 004: case 024: case 044: case 064: /* STA */
+- if (reason = Ea (MB, &Y)) /* eff addr */
++ if ((reason = Ea (MB, &Y))) /* eff addr */
+ break;
+ Write (Y, AR); /* store A */
+ if (dp) { /* double prec? */
+@@ -564,13 +564,13 @@ switch (I_GETOP (MB)) {
+ break;
+
+ case 005: case 025: case 045: case 065: /* ERA */
+- if (reason = Ea (MB, &Y)) /* eff addr */
++ if ((reason = Ea (MB, &Y))) /* eff addr */
+ break;
+ AR = AR ^ Read (Y);
+ break;
+
+ case 006: case 026: case 046: case 066: /* ADD */
+- if (reason = Ea (MB, &Y)) /* eff addr */
++ if ((reason = Ea (MB, &Y))) /* eff addr */
+ break;
+ if (dp) { /* double prec? */
+ t1 = GETDBL_S (AR, BR); /* get A'B */
+@@ -583,7 +583,7 @@ switch (I_GETOP (MB)) {
+ break;
+
+ case 007: case 027: case 047: case 067: /* SUB */
+- if (reason = Ea (MB, &Y)) /* eff addr */
++ if ((reason = Ea (MB, &Y))) /* eff addr */
+ break;
+ if (dp) { /* double prec? */
+ t1 = GETDBL_S (AR, BR); /* get A'B */
+@@ -596,7 +596,7 @@ switch (I_GETOP (MB)) {
+ break;
+
+ case 010: case 030: case 050: case 070: /* JST */
+- if (reason = Ea (MB, &Y)) /* eff addr */
++ if ((reason = Ea (MB, &Y))) /* eff addr */
+ break;
+ MB = NEWA (Read (Y), PC); /* merge old PC */
+ Write (Y, MB);
+@@ -605,7 +605,7 @@ switch (I_GETOP (MB)) {
+ break;
+
+ case 011: case 031: case 051: case 071: /* CAS */
+- if (reason = Ea (MB, &Y)) /* eff addr */
++ if ((reason = Ea (MB, &Y))) /* eff addr */
+ break;
+ MB = Read (Y);
+ if (AR == MB)
+@@ -615,7 +615,7 @@ switch (I_GETOP (MB)) {
+ break;
+
+ case 012: case 032: case 052: case 072: /* IRS */
+- if (reason = Ea (MB, &Y)) /* eff addr */
++ if ((reason = Ea (MB, &Y))) /* eff addr */
+ break;
+ MB = (Read (Y) + 1) & DMASK; /* incr, rewrite */
+ Write (Y, MB);
+@@ -624,7 +624,7 @@ switch (I_GETOP (MB)) {
+ break;
+
+ case 013: case 033: case 053: case 073: /* IMA */
+- if (reason = Ea (MB, &Y)) /* eff addr */
++ if ((reason = Ea (MB, &Y))) /* eff addr */
+ break;
+ MB = Read (Y);
+ Write (Y, AR); /* A to mem */
+@@ -632,13 +632,13 @@ switch (I_GETOP (MB)) {
+ break;
+
+ case 015: case 055: /* STX */
+- if (reason = Ea (MB & ~IDX, &Y)) /* eff addr */
++ if ((reason = Ea (MB & ~IDX, &Y))) /* eff addr */
+ break;
+ Write (Y, XR); /* store XR */
+ break;
+
+ case 035: case 075: /* LDX */
+- if (reason = Ea (MB & ~IDX, &Y)) /* eff addr */
++ if ((reason = Ea (MB & ~IDX, &Y))) /* eff addr */
+ break;
+ XR = Read (Y); /* load XR */
+ M[M_XR] = XR; /* update mem too */
+@@ -646,7 +646,7 @@ switch (I_GETOP (MB)) {
+
+ case 016: case 036: case 056: case 076: /* MPY */
+ if (cpu_unit.flags & UNIT_HSA) { /* installed? */
+- if (reason = Ea (MB, &Y)) /* eff addr */
++ if ((reason = Ea (MB, &Y))) /* eff addr */
+ break;
+ t1 = SEXT (AR) * SEXT (Read (Y));
+ PUTDBL_Z (t1);
+@@ -657,7 +657,7 @@ switch (I_GETOP (MB)) {
+
+ case 017: case 037: case 057: case 077: /* DIV */
+ if (cpu_unit.flags & UNIT_HSA) { /* installed? */
+- if (reason = Ea (MB, &Y)) /* eff addr */
++ if ((reason = Ea (MB, &Y))) /* eff addr */
+ break;
+ t2 = SEXT (Read (Y)); /* divr */
+ if (t2) { /* divr != 0? */
+@@ -826,7 +826,7 @@ switch (I_GETOP (MB)) {
+ break;
+
+ case 003: /* "long right arot" */
+- if (reason = stop_inst) /* stop on undef? */
++ if ((reason = stop_inst)) /* stop on undef? */
+ break;
+ for (t2 = 0; t2 < t1; t2++) { /* bit by bit */
+ C = BR & 1; /* C = last out */
+@@ -859,7 +859,7 @@ switch (I_GETOP (MB)) {
+ break;
+
+ case 007: /* "short right arot" */
+- if (reason = stop_inst) /* stop on undef? */
++ if ((reason = stop_inst)) /* stop on undef? */
+ break;
+ for (t2 = 0; t2 < t1; t2++) { /* bit by bit */
+ C = AR & 1; /* C = last out */
+@@ -899,7 +899,7 @@ switch (I_GETOP (MB)) {
+ break;
+
+ case 013: /* "long left arot" */
+- if (reason = stop_inst) /* stop on undef? */
++ if ((reason = stop_inst)) /* stop on undef? */
+ break;
+ for (t2 = 0; t2 < t1; t2++) { /* bit by bit */
+ AR = (AR << 1) | ((BR >> 14) & 1);
+@@ -935,7 +935,7 @@ switch (I_GETOP (MB)) {
+ break;
+
+ case 017: /* "short left arot" */
+- if (reason = stop_inst) /* stop on undef? */
++ if ((reason = stop_inst)) /* stop on undef? */
+ break;
+ for (t2 = 0; t2 < t1; t2++) { /* bit by bit */
+ if ((AR & SIGN) != ((AR << 1) & SIGN)) C = 1;
+@@ -1003,7 +1003,7 @@ switch (I_GETOP (MB)) {
+ AR = (AR << 8) & DMASK;
+ else if (MB == 0141340) /* ICA */
+ AR = ((AR << 8) | (AR >> 8)) & DMASK;
+- else if (reason = stop_inst)
++ else if ((reason = stop_inst))
+ break;
+ else AR = Operate (MB, AR); /* undefined */
+ break;
+@@ -1500,7 +1500,7 @@ for (i = 0; i < DEV_MAX; i++)
+ iotab[i] = NULL;
+ for (i = 0; i < (DMA_MAX + DMC_MAX); i++)
+ chan_map[i] = 0;
+-for (i = 0; dptr = sim_devices[i]; i++) { /* loop thru devices */
++for (i = 0; (dptr = sim_devices[i]); i++) { /* loop thru devices */
+ dibp = (DIB *) dptr->ctxt; /* get DIB */
+ if ((dibp == NULL) || (dptr->flags & DEV_DIS)) /* exist, enabled? */
+ continue;
diff --git a/emulators/simh/files/patch-H316_h316__dp.c b/emulators/simh/files/patch-H316_h316__dp.c
new file mode 100644
index 000000000000..aae4aafface5
--- /dev/null
+++ b/emulators/simh/files/patch-H316_h316__dp.c
@@ -0,0 +1,56 @@
+--- H316/h316_dp.c.orig 2016-12-01 22:43:42 UTC
++++ H316/h316_dp.c
+@@ -617,7 +617,7 @@ switch (uptr->FNC) {
+ case FNC_RCA: /* read current addr */
+ if (h >= dp_tab[dp_ctype].surf) /* invalid head? */
+ return dp_done (1, STA_ADRER); /* error */
+- if (r = dp_rdtrk (uptr, dpxb, uptr->CYL, h)) /* get track; error? */
++ if ((r = dp_rdtrk (uptr, dpxb, uptr->CYL, h))) /* get track; error? */
+ return r;
+ dp_rptr = 0; /* init rec ptr */
+ if (dpxb[dp_rptr + REC_LNT] == 0) /* unformated? */
+@@ -722,7 +722,7 @@ switch (uptr->FNC) {
+ case FNC_RW: /* read/write */
+ if (h >= dp_tab[dp_ctype].surf) /* invalid head? */
+ return dp_done (1, STA_ADRER); /* error */
+- if (r = dp_rdtrk (uptr, dpxb, uptr->CYL, h)) /* get track; error? */
++ if ((r = dp_rdtrk (uptr, dpxb, uptr->CYL, h))) /* get track; error? */
+ return r;
+ if (!dp_findrec (dp_cw2)) /* find rec; error? */
+ return dp_done (1, STA_ADRER); /* address error */
+@@ -750,7 +750,7 @@ switch (uptr->FNC) {
+ if (dp_cw1 & CW1_RW) { /* write? */
+ if (dp_sta & STA_RDY) /* timing failure? */
+ return dp_wrdone (uptr, STA_DTRER); /* yes, error */
+- if (r = dp_wrwd (uptr, dp_buf)) /* wr word, error? */
++ if ((r = dp_wrwd (uptr, dp_buf))) /* wr word, error? */
+ return r;
+ if (dp_eor) { /* transfer done? */
+ dpxb[dp_rptr + REC_DATA + dp_wptr] = dp_csum;
+@@ -855,7 +855,7 @@ if (dp_wptr < (lnt + REC_MAXEXT)) {
+ }
+ dpxb[dp_rptr + REC_DATA + dp_wptr] = dp_csum; /* write csum */
+ dpxb[dp_rptr + lnt + REC_OVHD] = 0; /* zap rest of track */
+-if (r = dp_wrdone (uptr, STA_UNSER)) /* dump track */
++if ((r = dp_wrdone (uptr, STA_UNSER))) /* dump track */
+ return r;
+ return STOP_DPOVR;
+ }
+@@ -1017,7 +1017,7 @@ for (c = cntr = 0; c < dp_tab[dp_ctype].
+ else tbuf[rptr + REC_ADDR] = (c << 8) + (h << 3) + i;
+ rptr = rptr + nw + REC_OVHD;
+ }
+- if (r = dp_wrtrk (uptr, tbuf, c, h))
++ if ((r = dp_wrtrk (uptr, tbuf, c, h)))
+ return r;
+ }
+ }
+@@ -1043,7 +1043,7 @@ if ((uptr->flags & UNIT_ATT) == 0)
+ return SCPE_UNATT;
+ for (c = 0; c < dp_tab[dp_ctype].cyl; c++) {
+ for (h = 0; h < dp_tab[dp_ctype].surf; h++) {
+- if (r = dp_rdtrk (uptr, tbuf, c, h))
++ if ((r = dp_rdtrk (uptr, tbuf, c, h)))
+ return r;
+ rptr = 0;
+ rlnt = tbuf[rptr + REC_LNT];
diff --git a/emulators/simh/files/patch-H316_h316__mt.c b/emulators/simh/files/patch-H316_h316__mt.c
new file mode 100644
index 000000000000..f893162684e5
--- /dev/null
+++ b/emulators/simh/files/patch-H316_h316__mt.c
@@ -0,0 +1,32 @@
+--- H316/h316_mt.c.orig 2016-12-01 22:43:42 UTC
++++ H316/h316_mt.c
+@@ -371,17 +371,17 @@ switch (uptr->FNC) {
+ return SCPE_OK;
+
+ case FNC_WEOF: /* write file mark */
+- if (st = sim_tape_wrtmk (uptr)) /* write tmk, err? */
++ if ((st = sim_tape_wrtmk (uptr))) /* write tmk, err? */
+ r = mt_map_err (uptr, st); /* map error */
+ break; /* sched end motion */
+
+ case FNC_FSR: /* space fwd rec */
+- if (st = sim_tape_sprecf (uptr, &tbc)) /* space fwd, err? */
++ if ((st = sim_tape_sprecf (uptr, &tbc))) /* space fwd, err? */
+ r = mt_map_err (uptr, st); /* map error */
+ break; /* sched end motion */
+
+ case FNC_BSR: /* space rev rec */
+- if (st = sim_tape_sprecr (uptr, &tbc)) /* space rev, err? */
++ if ((st = sim_tape_sprecr (uptr, &tbc))) /* space rev, err? */
+ r = mt_map_err (uptr, st); /* map error */
+ break; /* sched end motion */
+
+@@ -455,7 +455,7 @@ switch (uptr->FNC) {
+ mt_wrwd (uptr, mt_buf);
+ else mt_rdy = 0; /* rdy must be clr */
+ if (mt_ptr) { /* any data? */
+- if (st = sim_tape_wrrecf (uptr, mtxb, mt_ptr)) /* write, err? */
++ if ((st = sim_tape_wrrecf (uptr, mtxb, mt_ptr))) /* write, err? */
+ r = mt_map_err (uptr, st); /* map error */
+ }
+ break; /* sched end motion */
diff --git a/emulators/simh/files/patch-H316_h316__stddev.c b/emulators/simh/files/patch-H316_h316__stddev.c
new file mode 100644
index 000000000000..63eda3f58bbe
--- /dev/null
+++ b/emulators/simh/files/patch-H316_h316__stddev.c
@@ -0,0 +1,11 @@
+--- H316/h316_stddev.c.orig 2016-12-01 22:43:42 UTC
++++ H316/h316_stddev.c
+@@ -390,7 +390,7 @@ t_stat r;
+
+ if (!(uptr->flags & UNIT_ATTABLE))
+ return SCPE_NOFNC;
+-if (r = attach_unit (uptr, cptr))
++if ((r = attach_unit (uptr, cptr)))
+ return r;
+ if (sim_switches & SWMASK ('A')) /* -a? ASCII */
+ uptr->flags |= UNIT_ASC;
diff --git a/emulators/simh/files/patch-H316_h316__sys.c b/emulators/simh/files/patch-H316_h316__sys.c
new file mode 100644
index 000000000000..862dd1c66e2e
--- /dev/null
+++ b/emulators/simh/files/patch-H316_h316__sys.c
@@ -0,0 +1,16 @@
+--- H316/h316_sys.c.orig 2016-12-01 22:43:42 UTC
++++ H316/h316_sys.c
+@@ -364,11 +364,11 @@ switch (j) {
+
+ case I_V_MRF: case I_V_MRX: /* mem ref */
+ cptr = get_glyph (cptr, gbuf, ','); /* get next field */
+- if (k = (strcmp (gbuf, "C") == 0)) { /* C specified? */
++ if ((k = (strcmp (gbuf, "C") == 0))) { /* C specified? */
+ val[0] = val[0] | SC;
+ cptr = get_glyph (cptr, gbuf, 0);
+ }
+- else if (k = (strcmp (gbuf, "Z") == 0)) { /* Z specified? */
++ else if ((k = (strcmp (gbuf, "Z") == 0))) { /* Z specified? */
+ cptr = get_glyph (cptr, gbuf, ',');
+ }
+ d = get_uint (gbuf, 8, X_AMASK, &r); /* construe as addr */
diff --git a/emulators/simh/files/patch-HP2100_hp2100__baci.c b/emulators/simh/files/patch-HP2100_hp2100__baci.c
new file mode 100644
index 000000000000..1450d2ad0ed7
--- /dev/null
+++ b/emulators/simh/files/patch-HP2100_hp2100__baci.c
@@ -0,0 +1,50 @@
+--- HP2100/hp2100_baci.c.orig 2016-12-01 22:43:42 UTC
++++ HP2100/hp2100_baci.c
+@@ -670,7 +670,7 @@ while (working_set) {
+ if ((baci_icw ^ baci_obuf) & OUT_BAUDRATE) { /* baud rate change? */
+ baci_term.wait = service_time (baci_obuf); /* set service time to match rate */
+
+- if (baci_term.flags & UNIT_DIAG) /* diagnostic mode? */
++ if (baci_term.flags & UNIT_DIAG) { /* diagnostic mode? */
+ if (baci_obuf & OUT_BAUDRATE) { /* internal baud rate requested? */
+ sim_activate (&baci_term, /* activate I/O service */
+ baci_term.wait);
+@@ -687,6 +687,7 @@ while (working_set) {
+ fprintf (sim_deb, ">>BACI cmds: [OTx%s] Terminal service stopped\n",
+ hold_or_clear);
+ }
++ }
+ }
+
+ baci_icw = baci_obuf; /* load new reference word */
+@@ -1381,13 +1382,14 @@ else {
+
+ baci_fcount = baci_fcount + 1; /* increment occupancy counter */
+
+-if (DEBUG_PRI (baci_dev, DEB_BUF))
++if (DEBUG_PRI (baci_dev, DEB_BUF)) {
+ if (pass_thru)
+ fprintf (sim_deb, ">>BACI buf: Character %s put to UART transmitter holding register, "
+ "character counter = 1\n", fmt_char (ch));
+ else
+ fprintf (sim_deb, ">>BACI buf: Character %s put to FIFO [%d], "
+ "character counter = %d\n", fmt_char (ch), index, baci_fcount);
++}
+
+ if ((IO_MODE == RECV) && (baci_spchar [ch])) /* receive mode and special character? */
+ baci_status = baci_status | IN_SPCHAR; /* set special char seen flag */
+@@ -1447,12 +1449,13 @@ uint32 uart_bits, data_bits, data_mask,
+ if (baci_uart_clk > 0) { /* transfer in progress? */
+ bit_low = (baci_icw & OUT_CD); /* get current receive bit */
+
+- if ((baci_uart_clk & 017) == 0) /* end of a bit? */
++ if ((baci_uart_clk & 017) == 0) { /* end of a bit? */
+ if (IO_MODE == XMIT) /* transmit? */
+ baci_uart_tr = baci_uart_tr >> 1; /* shift new bit onto line */
+ else /* receive? */
+ baci_uart_rr = (baci_uart_rr >> 1) & /* shift new bit in */
+ (bit_low ? ~SIGN : -1); /* (inverted sense) */
++ }
+
+ if (bit_low) { /* another low bit? */
+ baci_bcount = baci_bcount + 1; /* update break counter */
diff --git a/emulators/simh/files/patch-HP2100_hp2100__cpu.c b/emulators/simh/files/patch-HP2100_hp2100__cpu.c
new file mode 100644
index 000000000000..13281410d348
--- /dev/null
+++ b/emulators/simh/files/patch-HP2100_hp2100__cpu.c
@@ -0,0 +1,89 @@
+--- HP2100/hp2100_cpu.c.orig 2016-12-01 22:43:42 UTC
++++ HP2100/hp2100_cpu.c
+@@ -1054,7 +1054,7 @@ for (i = OPTDEV; i <= MAXDEV; i++)
+
+ dtab [PWR] = &pwrf_dib; /* for now, powerfail is always present */
+
+-for (i = 0; dptr = sim_devices [i]; i++) { /* loop thru dev */
++for (i = 0; (dptr = sim_devices [i]); i++) { /* loop thru dev */
+ dibptr = (DIB *) dptr->ctxt; /* get DIB */
+
+ if (dibptr && !(dptr->flags & DEV_DIS)) { /* handler exists and device is enabled? */
+@@ -2153,13 +2153,13 @@ if (req_grant [0])
+ else /* not this one */
+ req_grant [0] = req_grant [0] >> 1; /* position next request */
+
+-else if (req_grant [1]) /* device in upper half */
++else if (req_grant [1]) { /* device in upper half */
+ for (sc = 32; sc <= 63; sc++) /* determine interrupting select code */
+ if (req_grant [1] & 1) /* grant this request? */
+ return sc; /* return this select code */
+ else /* not this one */
+ req_grant [1] = req_grant [1] >> 1; /* position next request */
+-
++ }
+ return 0; /* no interrupt granted */
+ }
+
+@@ -3611,7 +3611,7 @@ uint32 i, j, k;
+ t_bool is_conflict = FALSE;
+ uint32 conflicts[MAXDEV + 1] = { 0 };
+
+-for (i = 0; dptr = sim_devices[i]; i++) {
++for (i = 0; (dptr = sim_devices[i]); i++) {
+ dibptr = (DIB *) dptr->ctxt;
+ if (dibptr && !(dptr->flags & DEV_DIS))
+ if (++conflicts[dibptr->select_code] > 1)
+@@ -3629,7 +3629,7 @@ if (is_conflict) {
+ if (sim_log)
+ fprintf (sim_log, "Select code %o conflict:", i);
+
+- for (j = 0; dptr = sim_devices[j]; j++) {
++ for (j = 0; (dptr = sim_devices[j]); j++) {
+ dibptr = (DIB *) dptr->ctxt;
+ if (dibptr && !(dptr->flags & DEV_DIS) && (i == dibptr->select_code)) {
+ if (k < conflicts[i]) {
+@@ -3791,12 +3791,12 @@ else
+
+ result = cpu_set_size (uptr, new_memsize, NULL, NULL); /* set memory size */
+
+-if (result == SCPE_OK) /* memory change OK? */
++if (result == SCPE_OK) { /* memory change OK? */
+ if (new_family == UNIT_FAMILY_21XX) /* 21xx CPU? */
+ fwanxm = MEMSIZE - IBL_LNT; /* reserve memory for loader */
+ else
+ fwanxm = MEMSIZE; /* loader reserved only for 21xx */
+-
++ }
+ return result;
+ }
+
+@@ -3810,11 +3810,12 @@ t_stat cpu_show_model (FILE *st, UNIT *u
+ {
+ fputs ((char *) desc, st); /* write model name */
+
+-if (UNIT_CPU_FAMILY == UNIT_FAMILY_21XX) /* valid only for 21xx */
++if (UNIT_CPU_FAMILY == UNIT_FAMILY_21XX) { /* valid only for 21xx */
+ if (fwanxm < MEMSIZE) /* loader area non-existent? */
+ fputs (", loader disabled", st); /* yes, so access disabled */
+ else
+ fputs (", loader enabled", st); /* no, so access enabled */
++ }
+ return SCPE_OK;
+ }
+
+@@ -3846,12 +3847,12 @@ if (UNIT_CPU_TYPE == UNIT_TYPE_2100) {
+ uptr->flags = uptr->flags | UNIT_FP;
+ }
+
+-else if (UNIT_CPU_MODEL == UNIT_1000_F)
++else if (UNIT_CPU_MODEL == UNIT_1000_F) {
+ if (option == UNIT_VIS) /* 1000-F IOP and VIS options */
+ uptr->flags = uptr->flags & ~UNIT_IOP; /* are mutually exclusive */
+ else if (option == UNIT_IOP)
+ uptr->flags = uptr->flags & ~UNIT_VIS;
+-
++ }
+ return SCPE_OK;
+ }
+
diff --git a/emulators/simh/files/patch-HP2100_hp2100__cpu0.c b/emulators/simh/files/patch-HP2100_hp2100__cpu0.c
new file mode 100644
index 000000000000..90f3f9661222
--- /dev/null
+++ b/emulators/simh/files/patch-HP2100_hp2100__cpu0.c
@@ -0,0 +1,20 @@
+--- HP2100/hp2100_cpu0.c.orig 2016-12-01 22:43:42 UTC
++++ HP2100/hp2100_cpu0.c
+@@ -130,7 +130,7 @@ uint32 entry;
+ entry = IR & 017; /* mask to entry point */
+
+ if (op_ds[entry] != OP_N)
+- if (reason = cpu_ops (op_ds[entry], op, intrq)) /* get instruction operands */
++ if ((reason = cpu_ops (op_ds[entry], op, intrq))) /* get instruction operands */
+ return reason;
+
+ switch (entry) { /* decode IR<3:0> */
+@@ -244,7 +244,7 @@ uint32 entry;
+ entry = IR & 017; /* mask to entry point */
+
+ if (op_user_20 [entry] != OP_N)
+- if (reason = cpu_ops (op_user_20 [entry], op, intrq)) /* get instruction operands */
++ if ((reason = cpu_ops (op_user_20 [entry], op, intrq))) /* get instruction operands */
+ return reason;
+
+ switch (entry) { /* decode IR<4:0> */
diff --git a/emulators/simh/files/patch-HP2100_hp2100__cpu1.c b/emulators/simh/files/patch-HP2100_hp2100__cpu1.c
new file mode 100644
index 000000000000..b0cd1c4396bd
--- /dev/null
+++ b/emulators/simh/files/patch-HP2100_hp2100__cpu1.c
@@ -0,0 +1,63 @@
+--- HP2100/hp2100_cpu1.c.orig 2016-12-01 22:43:42 UTC
++++ HP2100/hp2100_cpu1.c
+@@ -193,11 +193,12 @@ OPS op;
+ uint32 rs, qs, sc, v1, v2, t;
+ int32 sop1, sop2;
+
+-if ((cpu_unit.flags & UNIT_EAU) == 0) /* option installed? */
++if ((cpu_unit.flags & UNIT_EAU) == 0) { /* option installed? */
+ if ((UNIT_CPU_MODEL == UNIT_2114) && (IR == 0101100)) /* 2114 and RRR 16? */
+ return SCPE_OK; /* allowed as NOP */
+ else
+ return stop_inst; /* fail */
++}
+
+ switch ((IR >> 8) & 0377) { /* decode IR<15:8> */
+
+@@ -245,7 +246,7 @@ switch ((IR >> 8) & 0377) {
+
+ case 010: /* MPY 100200 (OP_K) */
+ MPY:
+- if (reason = cpu_ops (OP_K, op, intrq)) /* get operand */
++ if ((reason = cpu_ops (OP_K, op, intrq))) /* get operand */
+ break;
+ sop1 = SEXT (AR); /* sext AR */
+ sop2 = SEXT (op[0].word); /* sext mem */
+@@ -262,9 +263,9 @@ switch ((IR >> 8) & 0377) {
+ break;
+
+ case 0201: /* DIV 100400 (OP_K) */
+- if (reason = cpu_ops (OP_K, op, intrq)) /* get operand */
++ if ((reason = cpu_ops (OP_K, op, intrq))) /* get operand */
+ break;
+- if (rs = qs = BR & SIGN) { /* save divd sign, neg? */
++ if ((rs = qs = BR & SIGN)) { /* save divd sign, neg? */
+ AR = (~AR + 1) & DMASK; /* make B'A pos */
+ BR = (~BR + (AR == 0)) & DMASK; /* make divd pos */
+ }
+@@ -317,14 +318,14 @@ switch ((IR >> 8) & 0377) {
+ break;
+
+ case 0210: /* DLD 104200 (OP_D) */
+- if (reason = cpu_ops (OP_D, op, intrq)) /* get operand */
++ if ((reason = cpu_ops (OP_D, op, intrq))) /* get operand */
+ break;
+ AR = (op[0].dword >> 16) & DMASK; /* load AR */
+ BR = op[0].dword & DMASK; /* load BR */
+ break;
+
+ case 0211: /* DST 104400 (OP_A) */
+- if (reason = cpu_ops (OP_A, op, intrq)) /* get operand */
++ if ((reason = cpu_ops (OP_A, op, intrq))) /* get operand */
+ break;
+ WriteW (op[0].word, AR); /* store AR */
+ WriteW ((op[0].word + 1) & VAMASK, BR); /* store BR */
+@@ -734,7 +735,7 @@ for (i = 0; i < OP_N_F; i++) {
+ flags = pattern & OP_M_FLAGS; /* get operand pattern */
+
+ if (flags >= OP_ADR) /* address operand? */
+- if (reason = resolve (ReadW (PC), &MA, irq)) /* resolve indirects */
++ if ((reason = resolve (ReadW (PC), &MA, irq))) /* resolve indirects */
+ return reason;
+
+ switch (flags) {
diff --git a/emulators/simh/files/patch-HP2100_hp2100__cpu2.c b/emulators/simh/files/patch-HP2100_hp2100__cpu2.c
new file mode 100644
index 000000000000..2362d3e9b662
--- /dev/null
+++ b/emulators/simh/files/patch-HP2100_hp2100__cpu2.c
@@ -0,0 +1,29 @@
+--- HP2100/hp2100_cpu2.c.orig 2016-12-01 22:43:42 UTC
++++ HP2100/hp2100_cpu2.c
+@@ -244,7 +244,7 @@ absel = (IR & I_AB)? 1: 0;
+ entry = IR & 037; /* mask to entry point */
+
+ if (op_dms[entry] != OP_N)
+- if (reason = cpu_ops (op_dms[entry], op, intrq)) /* get instruction operands */
++ if ((reason = cpu_ops (op_dms[entry], op, intrq))) /* get instruction operands */
+ return reason;
+
+ switch (entry) { /* decode IR<3:0> */
+@@ -610,7 +610,7 @@ absel = (IR & I_AB)? 1: 0;
+ entry = IR & 037; /* mask to entry point */
+
+ if (op_eig[entry] != OP_N)
+- if (reason = cpu_ops (op_eig[entry], op, intrq)) /* get instruction operands */
++ if ((reason = cpu_ops (op_eig[entry], op, intrq))) /* get instruction operands */
+ return reason;
+
+ switch (entry) { /* decode IR<4:0> */
+@@ -989,7 +989,7 @@ else if (entry <= 057)
+ entry = entry - 060; /* offset 10x460-477 */
+
+ if (op_iop[entry] != OP_N)
+- if (reason = cpu_ops (op_iop[entry], op, intrq)) /* get instruction operands */
++ if ((reason = cpu_ops (op_iop[entry], op, intrq))) /* get instruction operands */
+ return reason;
+
+ switch (entry) { /* decode IR<5:0> */
diff --git a/emulators/simh/files/patch-HP2100_hp2100__cpu3.c b/emulators/simh/files/patch-HP2100_hp2100__cpu3.c
new file mode 100644
index 000000000000..fed75ea0b907
--- /dev/null
+++ b/emulators/simh/files/patch-HP2100_hp2100__cpu3.c
@@ -0,0 +1,56 @@
+--- HP2100/hp2100_cpu3.c.orig 2016-12-01 22:43:42 UTC
++++ HP2100/hp2100_cpu3.c
+@@ -186,7 +186,7 @@ entry = IR & 037;
+
+ if (UNIT_CPU_MODEL != UNIT_1000_F) { /* 2100/M/E-Series? */
+ if (op_ffp_e[entry] != OP_N)
+- if (reason = cpu_ops (op_ffp_e[entry], op, intrq)) /* get instruction operands */
++ if ((reason = cpu_ops (op_ffp_e[entry], op, intrq))) /* get instruction operands */
+ return reason;
+ }
+
+@@ -194,7 +194,7 @@ if (UNIT_CPU_MODEL != UNIT_1000_F) {
+
+ else { /* F-Series */
+ if (op_ffp_f[entry] != OP_N)
+- if (reason = cpu_ops (op_ffp_f[entry], op, intrq)) /* get instruction operands */
++ if ((reason = cpu_ops (op_ffp_f[entry], op, intrq))) /* get instruction operands */
+ return reason;
+
+ switch (entry) { /* decode IR<4:0> */
+@@ -417,7 +417,7 @@ switch (entry) {
+ sa = op[0].word - 1;
+
+ da = ReadW (sa); /* get jump target */
+- if (reason = resolve (da, &MA, intrq)) { /* resolve indirects */
++ if ((reason = resolve (da, &MA, intrq))) { /* resolve indirects */
+ PC = err_PC; /* irq restarts instruction */
+ break;
+ }
+@@ -435,7 +435,7 @@ switch (entry) {
+ op[1].word = op[1].word + /* compute element offset */
+ (op[2].word - 1) * op[3].word;
+ else { /* 3-dim access */
+- if (reason = cpu_ops (OP_KK, op2, intrq)) { /* get 1st, 2nd ranges */
++ if ((reason = cpu_ops (OP_KK, op2, intrq))) { /* get 1st, 2nd ranges */
+ PC = err_PC; /* irq restarts instruction */
+ break;
+ }
+@@ -461,7 +461,7 @@ switch (entry) {
+
+ for (j = 0; j < sc; j++) {
+ MA = ReadW (sa++); /* get addr of actual */
+- if (reason = resolve (MA, &MA, intrq)) { /* resolve indirect */
++ if ((reason = resolve (MA, &MA, intrq))) { /* resolve indirect */
+ PC = err_PC; /* irq restarts instruction */
+ break;
+ }
+@@ -644,7 +644,7 @@ t_stat reason = SCPE_OK;
+ entry = IR & 017; /* mask to entry point */
+
+ if (op_dbi[entry] != OP_N)
+- if (reason = cpu_ops (op_dbi[entry], op, intrq)) /* get instruction operands */
++ if ((reason = cpu_ops (op_dbi[entry], op, intrq))) /* get instruction operands */
+ return reason;
+
+ switch (entry) { /* decode IR<3:0> */
diff --git a/emulators/simh/files/patch-HP2100_hp2100__cpu4.c b/emulators/simh/files/patch-HP2100_hp2100__cpu4.c
new file mode 100644
index 000000000000..8e7fba07337b
--- /dev/null
+++ b/emulators/simh/files/patch-HP2100_hp2100__cpu4.c
@@ -0,0 +1,20 @@
+--- HP2100/hp2100_cpu4.c.orig 2016-12-01 22:43:42 UTC
++++ HP2100/hp2100_cpu4.c
+@@ -261,7 +261,7 @@ else
+ entry = opcode & 0177; /* map to <6:0> */
+
+ if (op_fpp[entry] != OP_N)
+- if (reason = cpu_ops (op_fpp[entry], op, intrq)) /* get instruction operands */
++ if ((reason = cpu_ops (op_fpp[entry], op, intrq))) /* get instruction operands */
+ return reason;
+
+ switch (entry) { /* decode IR<6:0> */
+@@ -600,7 +600,7 @@ static const OP t_one = { { 0040000, 00
+ entry = IR & 017; /* mask to entry point */
+
+ if (op_sis[entry] != OP_N)
+- if (reason = cpu_ops (op_sis[entry], op, intrq)) /* get instruction operands */
++ if ((reason = cpu_ops (op_sis[entry], op, intrq))) /* get instruction operands */
+ return reason;
+
+ switch (entry) { /* decode IR<3:0> */
diff --git a/emulators/simh/files/patch-HP2100_hp2100__cpu5.c b/emulators/simh/files/patch-HP2100_hp2100__cpu5.c
new file mode 100644
index 000000000000..2d87092327c2
--- /dev/null
+++ b/emulators/simh/files/patch-HP2100_hp2100__cpu5.c
@@ -0,0 +1,20 @@
+--- HP2100/hp2100_cpu5.c.orig 2016-12-01 22:43:42 UTC
++++ HP2100/hp2100_cpu5.c
+@@ -650,7 +650,7 @@ entry = IR & 017;
+ pattern = op_vma[entry]; /* get operand pattern */
+
+ if (pattern != OP_N)
+- if (reason = cpu_ops (pattern, op, intrq)) /* get instruction operands */
++ if ((reason = cpu_ops (pattern, op, intrq))) /* get instruction operands */
+ return reason;
+
+ if (debug) { /* debugging? */
+@@ -1361,7 +1361,7 @@ entry = IR & 017;
+ pattern = op_ema[entry]; /* get operand pattern */
+
+ if (pattern != OP_N)
+- if (reason = cpu_ops (pattern, op, intrq)) /* get instruction operands */
++ if ((reason = cpu_ops (pattern, op, intrq))) /* get instruction operands */
+ return reason;
+
+ if (debug) { /* debugging? */
diff --git a/emulators/simh/files/patch-HP2100_hp2100__cpu6.c b/emulators/simh/files/patch-HP2100_hp2100__cpu6.c
new file mode 100644
index 000000000000..62d58d9708e5
--- /dev/null
+++ b/emulators/simh/files/patch-HP2100_hp2100__cpu6.c
@@ -0,0 +1,29 @@
+--- HP2100/hp2100_cpu6.c.orig 2016-12-01 22:43:42 UTC
++++ HP2100/hp2100_cpu6.c
+@@ -394,7 +394,7 @@ entry = IR & 017;
+ pattern = op_os[entry]; /* get operand pattern */
+
+ if (pattern != OP_N)
+- if (reason = cpu_ops (pattern, op, intrq)) /* get instruction operands */
++ if ((reason = cpu_ops (pattern, op, intrq))) /* get instruction operands */
+ return reason;
+
+ tbg_tick = tbg_tick || (IR == 0105357) && iotrap; /* set TBG interrupting flag */
+@@ -544,7 +544,7 @@ switch (entry) {
+ for (i = 0; i < count; i++) {
+ ma = ReadW (PC); /* get operand address */
+
+- if (reason = resolve (ma, &ma, intrq)) { /* resolve indirect */
++ if ((reason = resolve (ma, &ma, intrq))) { /* resolve indirect */
+ PC = err_PC; /* IRQ restarts instruction */
+ break;
+ }
+@@ -710,7 +710,7 @@ switch (entry) {
+ ma = ReadW (sa); /* get addr of actual */
+ sa = (sa + 1) & VAMASK; /* increment address */
+
+- if (reason = resolve (ma, &ma, intrq)) { /* resolve indirect */
++ if ((reason = resolve (ma, &ma, intrq))) { /* resolve indirect */
+ PC = err_PC; /* irq restarts instruction */
+ break;
+ }
diff --git a/emulators/simh/files/patch-HP2100_hp2100__cpu7.c b/emulators/simh/files/patch-HP2100_hp2100__cpu7.c
new file mode 100644
index 000000000000..4359e5b98f43
--- /dev/null
+++ b/emulators/simh/files/patch-HP2100_hp2100__cpu7.c
@@ -0,0 +1,20 @@
+--- HP2100/hp2100_cpu7.c.orig 2016-12-01 22:43:42 UTC
++++ HP2100/hp2100_cpu7.c
+@@ -391,7 +391,7 @@ if (pattern != OP_N)
+ rtn = rtn1 = ret.word; /* but save it just in case */
+ PC = (PC + 1) & VAMASK; /* move to next argument */
+ }
+- if (reason = cpu_ops (pattern, op, intrq)) /* get instruction operands */
++ if ((reason = cpu_ops (pattern, op, intrq))) /* get instruction operands */
+ return reason;
+
+ if (debug) { /* debugging? */
+@@ -653,7 +653,7 @@ t_bool debug = DEBUG_PRI (cpu_dev, DEB_S
+ entry = IR & 017; /* mask to entry point */
+
+ if (op_signal[entry] != OP_N)
+- if (reason = cpu_ops (op_signal[entry], op, intrq)) /* get instruction operands */
++ if ((reason = cpu_ops (op_signal[entry], op, intrq))) /* get instruction operands */
+ return reason;
+
+ if (debug) { /* debugging? */
diff --git a/emulators/simh/files/patch-HP2100_hp2100__di.c b/emulators/simh/files/patch-HP2100_hp2100__di.c
new file mode 100644
index 000000000000..093a13430d4d
--- /dev/null
+++ b/emulators/simh/files/patch-HP2100_hp2100__di.c
@@ -0,0 +1,76 @@
+--- HP2100/hp2100_di.c.orig 2016-12-01 22:43:42 UTC
++++ HP2100/hp2100_di.c
+@@ -607,13 +607,13 @@ while (working_set) {
+ else if (di_card->cntl_register & CNTL_NRFD) /* NRFD was set but is not now? */
+ deny |= BUS_NRFD; /* deny NRFD on the bus */
+
+- if (FIFO_FULL) /* is the FIFO full? */
++ if (FIFO_FULL) { /* is the FIFO full? */
+ if (data & CNTL_LSTN) /* is card now listening? */
+ assert |= BUS_NRFD; /* listener and a full FIFO asserts NRFD */
+
+ else if (di_card->cntl_register & CNTL_LSTN) /* was card a listener but is not now? */
+ deny |= BUS_NRFD; /* deny NRFD on the bus */
+-
++ }
+
+ if (SW8_SYSCTL) { /* system controller drives REN and IFC */
+ if (data & CNTL_REN) /* REN control */
+@@ -1452,14 +1452,14 @@ if (di_card->bus_cntl & BUS_IFC
+ }
+
+
+-if (di_card->cntl_register & CNTL_LSTN) /* is the card a listener? */
++if (di_card->cntl_register & CNTL_LSTN) { /* is the card a listener? */
+ if (di_card->cntl_register & CNTL_NRFD /* if explicitly requested */
+ || di_card->status_register & STAT_LBI /* or the last byte is in */
+ || FIFO_FULL) /* or the FIFO is full */
+ assert = BUS_NRFD; /* then assert NRFD */
+ else /* otherwise the card is ready for data */
+ deny |= BUS_NRFD; /* so deny NRFD */
+-
++ }
+ if (assert != deny) /* was there any change in bus state? */
+ di_bus_control (card, CONTROLLER, assert, deny); /* update the bus control */
+
+@@ -1813,7 +1813,7 @@ if (tag & TAG_EDT
+
+ if (access == cpu_access) { /* is this a cpu access? */
+ if (!(di_card->cntl_register & CNTL_PACK)) /* in unpacked mode? */
+- data = data & ~(DATA_ATN | DATA_EOI) /* substitute the ATN/EOI tag values */
++ data = (data & ~(DATA_ATN | DATA_EOI)) /* substitute the ATN/EOI tag values */
+ | (tag & (TAG_ATN | TAG_EOI)) >> DATA_SHIFT; /* into the data word */
+
+ if (tag & TAG_LBR) /* is this the last byte? */
+@@ -1856,25 +1856,25 @@ if (DEBUG_PRJ (dptrs [card], DEB_BUF)) {
+ }
+
+
+-if (di_card->cntl_register & CNTL_TALK) /* is the card talking? */
+- if (di_card->cntl_register & CNTL_PACK) /* is it in the packed mode? */
++if (di_card->cntl_register & CNTL_TALK) { /* is the card talking? */
++ if (di_card->cntl_register & CNTL_PACK) { /* is it in the packed mode? */
+ if (di_card->status_register & STAT_LBO /* yes, is the last byte out? */
+ && di_card->cntl_register & CNTL_EOI) /* and is EOI control enabled? */
+ di_card->bus_cntl |= BUS_EOI; /* assert EOI on the bus */
+ else
+ di_card->bus_cntl &= ~BUS_EOI; /* deny EOI on the bus */
+-
++ }
+ else { /* the card is in the unpacked mode */
+ if (di_card->cntl_register & CNTL_CIC) /* is the card the controller in charge? */
+ di_card->bus_cntl = /* assert or deny the ATN bus line */
+- di_card->bus_cntl & ~BUS_ATN /* from the ATN tag value */
++ (di_card->bus_cntl & ~BUS_ATN) /* from the ATN tag value */
+ | (tag & TAG_ATN) >> BUS_SHIFT;
+
+ di_card->bus_cntl = /* assert or deny the EOI bus line */
+- di_card->bus_cntl & ~BUS_EOI /* from the EOI tag value */
++ (di_card->bus_cntl & ~BUS_EOI) /* from the EOI tag value */
+ | (tag & TAG_EOI) >> BUS_SHIFT;
+ }
+-
++ }
+ return (uint16) data; /* return the data value */
+ }
+
diff --git a/emulators/simh/files/patch-HP2100_hp2100__di__da.c b/emulators/simh/files/patch-HP2100_hp2100__di__da.c
new file mode 100644
index 000000000000..50effa1b5645
--- /dev/null
+++ b/emulators/simh/files/patch-HP2100_hp2100__di__da.c
@@ -0,0 +1,60 @@
+--- HP2100/hp2100_di_da.c.orig 2016-12-01 22:43:42 UTC
++++ HP2100/hp2100_di_da.c
+@@ -1215,7 +1215,7 @@ if (GET_BUSADR (da_unit [unitno].flags)
+ if (ibl_copy (da_rom, da_dib.select_code)) /* copy the boot ROM to memory and configure */
+ return SCPE_IERR; /* return an internal error if the copy failed */
+
+-SR = SR & (IBL_OPT | IBL_DS_HEAD) /* set S to a reasonable value */
++SR = (SR & (IBL_OPT | IBL_DS_HEAD)) /* set S to a reasonable value */
+ | IBL_DS | IBL_MAN | (da_dib.select_code << IBL_V_DEV); /* before boot execution */
+
+ return SCPE_OK;
+@@ -1594,10 +1594,10 @@ if (di [da].bus_cntl & BUS_ATN) {
+ da_unit [unit].wait = icd_cntlr [unit].cmd_time; /* these are always scheduled and */
+ initiated = TRUE; /* logged as initiated */
+
+- if (if_state [unit] == read_wait /* if we're waiting for a send data secondary */
+- && message_address != 0x00 /* but it's not there */
+- || if_state [unit] == status_wait /* or a send status secondary, */
+- && message_address != 0x08) /* but it's not there */
++ if ((if_state [unit] == read_wait /* if we're waiting for a send data secondary */
++ && message_address != 0x00) /* but it's not there */
++ || (if_state [unit] == status_wait /* or a send status secondary, */
++ && message_address != 0x08)) /* but it's not there */
+ abort_command (unit, io_program_error, /* then abort the pending command */
+ idle); /* and process the new command */
+
+@@ -1738,7 +1738,7 @@ else {
+
+ put_buffer_byte (&icd_cntlr [unit], data); /* add the byte to the buffer */
+
+- if (icd_cntlr [unit].length == 0) /* is this the last parameter? */
++ if (icd_cntlr [unit].length == 0) { /* is this the last parameter? */
+ if (di [da].bus_cntl & BUS_EOI) /* does the host agree? */
+ initiated = start_command (unit); /* start the command and log the initiation */
+
+@@ -1747,6 +1747,7 @@ else {
+ error_sink); /* any additional parameter bytes */
+ initiated = TRUE; /* log the abort initiation */
+ }
++ }
+ break;
+
+
+@@ -1787,14 +1788,14 @@ if (accepted && DEBUG_PRI (da_dev, DEB_X
+ if (da_unit [unit].wait > 0) /* was service requested? */
+ activate_unit (&da_unit [unit]); /* schedule the unit */
+
+-if (initiated && DEBUG_PRI (da_dev, DEB_RWSC))
++if (initiated && DEBUG_PRI (da_dev, DEB_RWSC)) {
+ if (if_command [unit] == disc_command)
+ fprintf (sim_deb, ">>DA rwsc: Unit %d position %d %s disc command initiated\n",
+ unit, da_unit [unit].pos, dl_opcode_name (ICD, icd_cntlr [unit].opcode));
+ else
+ fprintf (sim_deb, ">>DA rwsc: Unit %d %s command initiated\n",
+ unit, if_command_name [if_command [unit]]);
+-
++}
+ return accepted; /* indicate the acceptance condition */
+ }
+
diff --git a/emulators/simh/files/patch-HP2100_hp2100__dp.c b/emulators/simh/files/patch-HP2100_hp2100__dp.c
new file mode 100644
index 000000000000..847bf16cd899
--- /dev/null
+++ b/emulators/simh/files/patch-HP2100_hp2100__dp.c
@@ -0,0 +1,39 @@
+--- HP2100/hp2100_dp.c.orig 2016-12-01 22:43:42 UTC
++++ HP2100/hp2100_dp.c
+@@ -694,7 +694,7 @@ void dp_goc (int32 fnc, int32 drv, int32
+ {
+ int32 t;
+
+-if (t = sim_is_active (&dpc_unit[drv])) { /* still seeking? */
++if ((t = sim_is_active (&dpc_unit[drv]))) { /* still seeking? */
+ sim_cancel (&dpc_unit[drv]); /* stop seek */
+ dpc_sta[drv] = dpc_sta[drv] & ~STA_BSY; /* clear busy */
+ time = time + t; /* include seek time */
+@@ -906,10 +906,10 @@ switch (uptr->FNC) {
+ dpc_rarh = dpc_rarh ^ 1; /* incr head */
+ dpc_eoc = ((dpc_rarh & 1) == 0); /* calc eoc */
+ }
+- if (err = fseek (uptr->fileref, da * sizeof (int16),
+- SEEK_SET)) break;
++ if ((err = fseek (uptr->fileref, da * sizeof (int16),
++ SEEK_SET))) break;
+ fxread (dpxb, sizeof (int16), DP_NUMWD, uptr->fileref);
+- if (err = ferror (uptr->fileref)) break;
++ if ((err = ferror (uptr->fileref))) break;
+ }
+ dpd_ibuf = dpxb[dp_ptr++]; /* get word */
+ if (dp_ptr >= DP_NUMWD) { /* end of sector? */
+@@ -953,10 +953,10 @@ switch (uptr->FNC) {
+ dpc_rarh = dpc_rarh ^ 1; /* incr head */
+ dpc_eoc = ((dpc_rarh & 1) == 0); /* calc eoc */
+ }
+- if (err = fseek (uptr->fileref, da * sizeof (int16),
+- SEEK_SET)) break;
++ if ((err = fseek (uptr->fileref, da * sizeof (int16),
++ SEEK_SET))) break;
+ fxwrite (dpxb, sizeof (int16), DP_NUMWD, uptr->fileref);
+- if (err = ferror (uptr->fileref)) break; /* error? */
++ if ((err = ferror (uptr->fileref))) break; /* error? */
+ dp_ptr = 0; /* next sector */
+ }
+ if (dpd.command && dpd_xfer) /* dch on, xfer? */
diff --git a/emulators/simh/files/patch-HP2100_hp2100__dq.c b/emulators/simh/files/patch-HP2100_hp2100__dq.c
new file mode 100644
index 000000000000..c99416253232
--- /dev/null
+++ b/emulators/simh/files/patch-HP2100_hp2100__dq.c
@@ -0,0 +1,39 @@
+--- HP2100/hp2100_dq.c.orig 2016-12-01 22:43:42 UTC
++++ HP2100/hp2100_dq.c
+@@ -530,7 +530,7 @@ void dq_goc (int32 fnc, int32 drv, int32
+ {
+ int32 t;
+
+-if (t = sim_is_active (&dqc_unit[drv])) { /* still seeking? */
++if ((t = sim_is_active (&dqc_unit[drv]))) { /* still seeking? */
+ sim_cancel (&dqc_unit[drv]); /* cancel */
+ time = time + t; /* include seek time */
+ }
+@@ -740,10 +740,10 @@ switch (uptr->FNC) {
+ dqc_rars = (dqc_rars + 1) % DQ_NUMSC; /* incr sector */
+ if (dqc_rars == 0) /* wrap? incr head */
+ dqc_uhed[drv] = dqc_rarh = dqc_rarh + 1;
+- if (err = fseek (uptr->fileref, da * sizeof (int16),
+- SEEK_SET)) break;
++ if ((err = fseek (uptr->fileref, da * sizeof (int16),
++ SEEK_SET))) break;
+ fxread (dqxb, sizeof (int16), DQ_NUMWD, uptr->fileref);
+- if (err = ferror (uptr->fileref)) break;
++ if ((err = ferror (uptr->fileref))) break;
+ }
+ dqd_ibuf = dqxb[dq_ptr++]; /* get word */
+ if (dq_ptr >= DQ_NUMWD) { /* end of sector? */
+@@ -786,10 +786,10 @@ switch (uptr->FNC) {
+ dqc_rars = (dqc_rars + 1) % DQ_NUMSC; /* incr sector */
+ if (dqc_rars == 0) /* wrap? incr head */
+ dqc_uhed[drv] = dqc_rarh = dqc_rarh + 1;
+- if (err = fseek (uptr->fileref, da * sizeof (int16),
+- SEEK_SET)) return TRUE;
++ if ((err = fseek (uptr->fileref, da * sizeof (int16),
++ SEEK_SET))) return TRUE;
+ fxwrite (dqxb, sizeof (int16), DQ_NUMWD, uptr->fileref);
+- if (err = ferror (uptr->fileref)) break;
++ if ((err = ferror (uptr->fileref))) break;
+ dq_ptr = 0;
+ }
+ if (dqd.command && dqd_xfer) { /* dch on, xfer? */
diff --git a/emulators/simh/files/patch-HP2100_hp2100__fp1.c b/emulators/simh/files/patch-HP2100_hp2100__fp1.c
new file mode 100644
index 000000000000..65844a31b969
--- /dev/null
+++ b/emulators/simh/files/patch-HP2100_hp2100__fp1.c
@@ -0,0 +1,17 @@
+--- HP2100/hp2100_fp1.c.orig 2016-12-01 22:43:42 UTC
++++ HP2100/hp2100_fp1.c
+@@ -1145,12 +1145,12 @@ if (operand_l && operand_r) {
+ *operand_l = fp_a; /* first op is accum */
+ }
+
+-if (result) /* want result precision? */
++if (result) { /* want result precision? */
+ if ((opcode & 0120) == 0100) /* fix? */
+ *result = int_size; /* result is integer */
+ else /* all others */
+ *result = fp_size; /* result is fp */
+-
++}
+ return;
+ }
+
diff --git a/emulators/simh/files/patch-HP2100_hp2100__ipl.c b/emulators/simh/files/patch-HP2100_hp2100__ipl.c
new file mode 100644
index 000000000000..fb967c3bf0ac
--- /dev/null
+++ b/emulators/simh/files/patch-HP2100_hp2100__ipl.c
@@ -0,0 +1,11 @@
+--- HP2100/hp2100_ipl.c.orig 2016-12-01 22:43:42 UTC
++++ HP2100/hp2100_ipl.c
+@@ -623,7 +623,7 @@ uptr->filename = tptr;
+ sim_activate (uptr, POLL_FIRST); /* activate first poll "immediately" */
+ if (sim_switches & SWMASK ('W')) { /* wait? */
+ for (i = 0; i < 30; i++) { /* check for 30 sec */
+- if (t = ipl_check_conn (uptr)) /* established? */
++ if ((t = ipl_check_conn (uptr))) /* established? */
+ break;
+ if ((i % 10) == 0) /* status every 10 sec */
+ printf ("Waiting for connnection\n");
diff --git a/emulators/simh/files/patch-HP2100_hp2100__lps.c b/emulators/simh/files/patch-HP2100_hp2100__lps.c
new file mode 100644
index 000000000000..91d014dee9b8
--- /dev/null
+++ b/emulators/simh/files/patch-HP2100_hp2100__lps.c
@@ -0,0 +1,16 @@
+--- HP2100/hp2100_lps.c.orig 2016-12-01 22:43:42 UTC
++++ HP2100/hp2100_lps.c
+@@ -372,11 +372,12 @@ while (working_set) {
+ if (lps_unit.flags & UNIT_DIAG) { /* diagnostic? */
+ lps_sta = lps_unit.buf; /* loop back data */
+
+- if (!(signal_set & ioCLC)) /* CLC not asserted simultaneously? */
++ if (!(signal_set & ioCLC)) { /* CLC not asserted simultaneously? */
+ if (UNIT_CPU_TYPE == UNIT_TYPE_211X) /* 2114/15/16 CPU? */
+ sim_activate (&lps_unit, 3); /* schedule flag after two instructions */
+ else /* 2100 or 1000 */
+ sim_activate (&lps_unit, 2); /* schedule flag after next instruction */
++ }
+ }
+
+ else { /* real lpt, sched */
diff --git a/emulators/simh/files/patch-HP2100_hp2100__mpx.c b/emulators/simh/files/patch-HP2100_hp2100__mpx.c
new file mode 100644
index 000000000000..8fbabc36a698
--- /dev/null
+++ b/emulators/simh/files/patch-HP2100_hp2100__mpx.c
@@ -0,0 +1,70 @@
+--- HP2100/hp2100_mpx.c.orig 2016-12-01 22:43:42 UTC
++++ HP2100/hp2100_mpx.c
+@@ -1153,7 +1153,7 @@ switch (mpx_cmd) {
+ case CMD_REQ_WRITE: /* request write buffer */
+ port = key_to_port (mpx_portkey); /* get port */
+
+- if (port >= 0) /* port defined? */
++ if (port >= 0) { /* port defined? */
+ if (buf_avail (iowrite, port) > 0) /* is a buffer available? */
+ mpx_ibuf = WR_BUF_LIMIT; /* report write buffer limit */
+
+@@ -1161,6 +1161,7 @@ switch (mpx_cmd) {
+ mpx_ibuf = 0; /* report none available */
+ mpx_flags [port] |= FL_WANTBUF; /* set buffer request */
+ }
++ }
+ break;
+
+
+@@ -1251,7 +1252,7 @@ switch (mpx_cmd) {
+ case CMD_TERM_BUF: /* terminate active receive buffer */
+ port = key_to_port (mpx_portkey); /* get port */
+
+- if (port >= 0) /* port defined? */
++ if (port >= 0) { /* port defined? */
+ if (buf_len (ioread, port, put) > 0) { /* any chars in buffer? */
+ buf_term (ioread, port, 0); /* terminate buffer and set header */
+
+@@ -1263,6 +1264,7 @@ switch (mpx_cmd) {
+ mpx_charcnt [port] = 1; /* set to terminate on one char */
+ mpx_flags [port] |= FL_ALERT; /* set alert flag */
+ }
++ }
+ break;
+
+
+@@ -1784,7 +1786,7 @@ while (recv_loop &&
+ }
+
+ else { /* buffer is available */
+- if (rt & RT_ENAB_EDIT) /* editing enabled? */
++ if (rt & RT_ENAB_EDIT) { /* editing enabled? */
+ if (ch == BS) { /* backspace? */
+ if (buf_len (ioread, port, put) > 0) /* at least one character in buffer? */
+ buf_remove (ioread, port); /* remove last char */
+@@ -1814,6 +1816,7 @@ while (recv_loop &&
+
+ continue;
+ }
++ }
+
+ if (uptr->flags & UNIT_CAPSLOCK) /* caps lock mode? */
+ ch = toupper (ch); /* convert to upper case if lower */
+@@ -2473,14 +2476,14 @@ else
+
+ buf_incr (mpx_get, port, rw, +1); /* increment circular get index */
+
+-if (DEBUG_PRI (mpx_dev, DEB_BUF))
++if (DEBUG_PRI (mpx_dev, DEB_BUF)) {
+ if (mpx_flags [port] & emptying_flags [rw])
+ fprintf (sim_deb, ">>MPX buf: Port %d character %s get from %s buffer "
+ "[%d]\n", port, fmt_char (ch), io_op [rw], index);
+ else
+ fprintf (sim_deb, ">>MPX buf: Port %d header %03o get from %s buffer "
+ "[%d]\n", port, ch, io_op [rw], index);
+-
++ }
+ if (mpx_get [port] [rw] == mpx_sep [port] [rw]) /* buffer now empty? */
+ mpx_flags [port] &= ~emptying_flags [rw]; /* clear "buffer emptying" flag */
+ else
diff --git a/emulators/simh/files/patch-HP2100_hp2100__ms.c b/emulators/simh/files/patch-HP2100_hp2100__ms.c
new file mode 100644
index 000000000000..f6fb7f9f6fa8
--- /dev/null
+++ b/emulators/simh/files/patch-HP2100_hp2100__ms.c
@@ -0,0 +1,72 @@
+--- HP2100/hp2100_ms.c.orig 2016-12-01 22:43:42 UTC
++++ HP2100/hp2100_ms.c
+@@ -737,7 +737,7 @@ switch (uptr->FNC) {
+ fprintf (sim_deb,
+ ">>MSC svc: Unit %d wrote initial gap\n",
+ unum);
+- if (st = ms_write_gap (uptr)) { /* write initial gap; error? */
++ if ((st = ms_write_gap (uptr))) { /* write initial gap; error? */
+ r = ms_map_err (uptr, st); /* map error */
+ break; /* terminate operation */
+ }
+@@ -747,13 +747,13 @@ switch (uptr->FNC) {
+ fprintf (sim_deb,
+ ">>MSC svc: Unit %d wrote file mark\n",
+ unum);
+- if (st = sim_tape_wrtmk (uptr)) /* write tmk, err? */
++ if ((st = sim_tape_wrtmk (uptr))) /* write tmk, err? */
+ r = ms_map_err (uptr, st); /* map error */
+ msc_sta = STA_EOF; /* set EOF status */
+ break;
+
+ case FNC_FSR: /* space forward */
+- if (st = sim_tape_sprecf (uptr, &tbc)) /* space rec fwd, err? */
++ if ((st = sim_tape_sprecf (uptr, &tbc))) /* space rec fwd, err? */
+ r = ms_map_err (uptr, st); /* map error */
+ if (tbc & 1)
+ msc_sta = msc_sta | STA_ODD;
+@@ -761,7 +761,7 @@ switch (uptr->FNC) {
+ break;
+
+ case FNC_BSR: /* space reverse */
+- if (st = sim_tape_sprecr (uptr, &tbc)) /* space rec rev, err? */
++ if ((st = sim_tape_sprecr (uptr, &tbc))) /* space rec rev, err? */
+ r = ms_map_err (uptr, st); /* map error */
+ if (tbc & 1)
+ msc_sta = msc_sta | STA_ODD;
+@@ -831,7 +831,7 @@ switch (uptr->FNC) {
+ fprintf (sim_deb,
+ ">>MSC svc: Unit %d wrote initial gap\n",
+ unum);
+- if (st = ms_write_gap (uptr)) { /* write initial gap; error? */
++ if ((st = ms_write_gap (uptr))) { /* write initial gap; error? */
+ r = ms_map_err (uptr, st); /* map error */
+ break; /* terminate operation */
+ }
+@@ -855,7 +855,7 @@ switch (uptr->FNC) {
+ fprintf (sim_deb,
+ ">>MSC svc: Unit %d wrote %d word record\n",
+ unum, ms_ptr / 2);
+- if (st = sim_tape_wrrecf (uptr, msxb, ms_ptr)) { /* write, err? */
++ if ((st = sim_tape_wrrecf (uptr, msxb, ms_ptr))) { /* write, err? */
+ r = ms_map_err (uptr, st); /* map error */
+ break;
+ }
+@@ -894,7 +894,7 @@ t_stat st;
+ uint32 gap_len = ms_ctype ? GAP_13183 : GAP_13181; /* establish gap length */
+ uint32 tape_bpi = ms_ctype ? BPI_13183 : BPI_13181; /* establish nominal bpi */
+
+-if (st = sim_tape_wrgap (uptr, gap_len, tape_bpi)) /* write gap */
++if ((st = sim_tape_wrgap (uptr, gap_len, tape_bpi))) /* write gap */
+ return ms_map_err (uptr, st); /* map error if failure */
+ else
+ return SCPE_OK;
+@@ -974,7 +974,7 @@ for (i = 0; i < MS_NUMDR; i++) {
+ fprintf (sim_deb,
+ ">>MSC rws: Unit %d wrote %d word partial record\n", i, ms_ptr / 2);
+
+- if (st = sim_tape_wrrecf (uptr, msxb, ms_ptr | MTR_ERF))
++ if ((st = sim_tape_wrrecf (uptr, msxb, ms_ptr | MTR_ERF)))
+ ms_map_err (uptr, st); /* discard any error */
+
+ ms_ptr = 0; /* clear partial */
diff --git a/emulators/simh/files/patch-HP2100_hp2100__mt.c b/emulators/simh/files/patch-HP2100_hp2100__mt.c
new file mode 100644
index 000000000000..7d3c714aef0b
--- /dev/null
+++ b/emulators/simh/files/patch-HP2100_hp2100__mt.c
@@ -0,0 +1,44 @@
+--- HP2100/hp2100_mt.c.orig 2016-12-01 22:43:42 UTC
++++ HP2100/hp2100_mt.c
+@@ -495,7 +495,7 @@ switch (mtc_fnc) {
+ return sim_tape_detach (uptr); /* don't set cch flg */
+
+ case FNC_WFM: /* write file mark */
+- if (st = sim_tape_wrtmk (uptr)) /* write tmk, err? */
++ if ((st = sim_tape_wrtmk (uptr))) /* write tmk, err? */
+ r = mt_map_err (uptr, st); /* map error */
+ mtc_sta = STA_EOF; /* set EOF status */
+ break;
+@@ -504,12 +504,12 @@ switch (mtc_fnc) {
+ break;
+
+ case FNC_FSR: /* space forward */
+- if (st = sim_tape_sprecf (uptr, &tbc)) /* space rec fwd, err? */
++ if ((st = sim_tape_sprecf (uptr, &tbc))) /* space rec fwd, err? */
+ r = mt_map_err (uptr, st); /* map error */
+ break;
+
+ case FNC_BSR: /* space reverse */
+- if (st = sim_tape_sprecr (uptr, &tbc)) /* space rec rev, err? */
++ if ((st = sim_tape_sprecr (uptr, &tbc))) /* space rec rev, err? */
+ r = mt_map_err (uptr, st); /* map error */
+ break;
+
+@@ -558,7 +558,7 @@ switch (mtc_fnc) {
+ return SCPE_OK;
+ }
+ if (mt_ptr) { /* write buffer */
+- if (st = sim_tape_wrrecf (uptr, mtxb, mt_ptr)) { /* write, err? */
++ if ((st = sim_tape_wrrecf (uptr, mtxb, mt_ptr))) { /* write, err? */
+ r = mt_map_err (uptr, st); /* map error */
+ break; /* done */
+ }
+@@ -627,7 +627,7 @@ t_stat st;
+
+ if (sim_is_active (&mtc_unit) && /* write in prog? */
+ (mtc_fnc == FNC_WC) && (mt_ptr > 0)) { /* yes, bad rec */
+- if (st = sim_tape_wrrecf (&mtc_unit, mtxb, mt_ptr | MTR_ERF))
++ if ((st = sim_tape_wrrecf (&mtc_unit, mtxb, mt_ptr | MTR_ERF)))
+ mt_map_err (&mtc_unit, st);
+ }
+
diff --git a/emulators/simh/files/patch-HP2100_hp2100__mux.c b/emulators/simh/files/patch-HP2100_hp2100__mux.c
new file mode 100644
index 000000000000..33c1f28c356a
--- /dev/null
+++ b/emulators/simh/files/patch-HP2100_hp2100__mux.c
@@ -0,0 +1,30 @@
+--- HP2100/hp2100_mux.c.orig 2016-12-01 22:43:42 UTC
++++ HP2100/hp2100_mux.c
+@@ -650,11 +650,12 @@ while (working_set) {
+ case ioIOO: /* I/O data output */
+ muxl_obuf = IODATA (stat_data); /* store data */
+
+- if (DEBUG_PRI (muxu_dev, DEB_CPU))
++ if (DEBUG_PRI (muxu_dev, DEB_CPU)) {
+ if (muxl_obuf & OTL_P)
+ fprintf (sim_deb, ">>MUXl cpu: [OTx%s] Parameter = %06o\n", hold_or_clear, muxl_obuf);
+ else
+ fprintf (sim_deb, ">>MUXl cpu: [OTx%s] Data = %06o\n", hold_or_clear, muxl_obuf);
++ }
+ break;
+
+
+@@ -1107,11 +1108,12 @@ if (c & SCPE_BREAK) {
+ mux_rbuf[ln] = 0; /* break returns NUL */
+ mux_sta[ln] = mux_sta[ln] | LIU_BRK; /* set break status */
+
+- if (DEBUG_PRI (muxu_dev, DEB_XFER))
++ if (DEBUG_PRI (muxu_dev, DEB_XFER)) {
+ if (diag)
+ fputs (">>MUXl xfer: Break detected\n", sim_deb);
+ else
+ fputs (">>MUXl xfer: Deferred break processed\n", sim_deb);
++ }
+ }
+
+ else {
diff --git a/emulators/simh/files/patch-HP2100_hp2100__stddev.c b/emulators/simh/files/patch-HP2100_hp2100__stddev.c
new file mode 100644
index 000000000000..5c2fbb73b286
--- /dev/null
+++ b/emulators/simh/files/patch-HP2100_hp2100__stddev.c
@@ -0,0 +1,25 @@
+--- HP2100/hp2100_stddev.c.orig 2016-12-01 22:43:42 UTC
++++ HP2100/hp2100_stddev.c
+@@ -942,7 +942,7 @@ t_stat r;
+ if (tty_mode & TM_PRI) { /* printing? */
+ c = sim_tt_outcvt (c, TT_GET_MODE (tty_unit[TTO].flags));
+ if (c >= 0) { /* valid? */
+- if (r = sim_putchar_s (c)) return r; /* output char */
++ if ((r = sim_putchar_s (c))) return r; /* output char */
+ tty_unit[TTO].pos = tty_unit[TTO].pos + 1;
+ }
+ }
+@@ -1112,11 +1112,12 @@ while (working_set) {
+ if (!sim_is_active (&clk_unit)) { /* clock running? */
+ clk_tick = clk_delay (0); /* get tick count */
+
+- if ((clk_unit.flags & UNIT_DIAG) == 0) /* calibrated? */
++ if ((clk_unit.flags & UNIT_DIAG) == 0) { /* calibrated? */
+ if (clk_select == 2) /* 10 msec. interval? */
+ clk_tick = sync_poll (INITIAL); /* sync poll */
+ else
+ sim_rtcn_init (clk_tick, TMR_CLK); /* initialize timer */
++ }
+
+ sim_activate (&clk_unit, clk_tick); /* start clock */
+ clk_ctr = clk_delay (1); /* set repeat ctr */
diff --git a/emulators/simh/files/patch-HP2100_hp2100__sys.c b/emulators/simh/files/patch-HP2100_hp2100__sys.c
new file mode 100644
index 000000000000..cd547cdfd6b2
--- /dev/null
+++ b/emulators/simh/files/patch-HP2100_hp2100__sys.c
@@ -0,0 +1,16 @@
+--- HP2100/hp2100_sys.c.orig 2016-12-01 22:43:42 UTC
++++ HP2100/hp2100_sys.c
+@@ -608,11 +608,11 @@ if (opcode[i]) {
+
+ case I_V_MRF: /* mem ref */
+ cptr = get_glyph (cptr, gbuf, 0); /* get next field */
+- if (k = (strcmp (gbuf, "C") == 0)) { /* C specified? */
++ if ((k = (strcmp (gbuf, "C") == 0))) { /* C specified? */
+ val[0] = val[0] | I_CP;
+ cptr = get_glyph (cptr, gbuf, 0);
+ }
+- else if (k = (strcmp (gbuf, "Z") == 0)) { /* Z specified? */
++ else if ((k = (strcmp (gbuf, "Z") == 0))) { /* Z specified? */
+ cptr = get_glyph (cptr, gbuf, ',');
+ }
+ if ((d = get_addr (gbuf)) < 0) return SCPE_ARG;
diff --git a/emulators/simh/files/patch-HP2100_hp__disclib.c b/emulators/simh/files/patch-HP2100_hp__disclib.c
new file mode 100644
index 000000000000..770b4b9507e9
--- /dev/null
+++ b/emulators/simh/files/patch-HP2100_hp__disclib.c
@@ -0,0 +1,69 @@
+--- HP2100/hp_disclib.c.orig 2016-12-01 22:43:42 UTC
++++ HP2100/hp_disclib.c
+@@ -761,8 +761,8 @@ else {
+ uptr = units + unit_limit; /* and we use the indicated unit */
+ }
+
+-if (props->unit_check && !uptr /* if the unit number is checked and is invalid */
+- || props->seek_wait && (drive_status (uptr) & DL_S2STOPS)) { /* or if we're waiting for an offline drive */
++if ((props->unit_check && !uptr) /* if the unit number is checked and is invalid */
++ || (props->seek_wait && (drive_status (uptr) & DL_S2STOPS))) {/* or if we're waiting for an offline drive */
+ dl_end_command (cvptr, status_2_error); /* then the command ends with a Status-2 error */
+ uptr = NULL; /* prevent the command from starting */
+ }
+@@ -1563,7 +1563,7 @@ t_stat dl_load_unload (CVPTR cvptr, UNIT
+ if ((uptr->flags & UNIT_ATT) == 0) /* the unit must be attached to [un]load */
+ return SCPE_UNATT; /* return "Unit not attached" if not */
+
+-else if (!(sim_switches & SIM_SW_REST)) /* modify the flags only if not restoring */
++else if (!(sim_switches & SIM_SW_REST)) { /* modify the flags only if not restoring */
+ if (load) { /* are we loading the heads? */
+ uptr->flags = uptr->flags & ~UNIT_UNLOAD; /* clear the unload flag */
+ uptr->STAT = DL_S2FS; /* and set First Status */
+@@ -1576,7 +1576,7 @@ else if (!(sim_switches & SIM_SW_REST))
+ uptr->flags = uptr->flags | UNIT_UNLOAD; /* set the unload flag */
+ uptr->STAT = DL_S2ATN; /* and Attention status */
+ }
+-
++ }
+ return SCPE_OK;
+ }
+
+@@ -1897,7 +1897,7 @@ static void start_write (CVPTR cvptr, UN
+ const t_bool verify = (CNTLR_OPCODE) uptr->OP == write; /* only Write verifies the sector address */
+
+ if ((uptr->flags & UNIT_WPROT) /* is the unit write protected, */
+- || !verify && !(uptr->flags & UNIT_FMT)) /* or is formatting required but not enabled? */
++ || (!verify && !(uptr->flags & UNIT_FMT))) /* or is formatting required but not enabled? */
+ dl_end_command (cvptr, status_2_error); /* terminate the write with an error */
+
+ else if (position_sector (cvptr, uptr, verify)) { /* writing is permitted; position the sector */
+@@ -2041,11 +2041,12 @@ if (cvptr->eoc == SET)
+ (CNTLR_OPCODE) uptr->OP, /* with the current operation */
+ (CNTLR_PHASE) uptr->PHASE); /* and phase unchanged */
+
+- if (uptr->STAT & DL_S2SC) /* did a seek check occur? */
++ if (uptr->STAT & DL_S2SC) { /* did a seek check occur? */
+ if (cvptr->type == ICD) /* is this ICD controller? */
+ dl_end_command (cvptr, end_of_cylinder); /* report it as an End of Cylinder error */
+ else /* it is a MAC controller */
+ dl_end_command (cvptr, status_2_error); /* report it as a Status-2 error */
++ }
+ }
+
+ else /* the file mask does not permit an auto-seek */
+@@ -2291,12 +2292,13 @@ return;
+
+ static void set_timer (CVPTR cvptr, FLIP_FLOP action)
+ {
+-if (cvptr->type == MAC) /* is this a MAC controller? */
++if (cvptr->type == MAC) { /* is this a MAC controller? */
+ if (action == SET) /* should we start the timer? */
+ sim_activate_abs (cvptr->aux + timer, /* activate the auxiliary unit */
+ cvptr->wait_time);
+ else /* we stop the timer */
+ sim_cancel (cvptr->aux + timer); /* by canceling the unit */
++}
+ return;
+ }
+
diff --git a/emulators/simh/files/patch-I1401_i1401__cd.c b/emulators/simh/files/patch-I1401_i1401__cd.c
new file mode 100644
index 000000000000..5e4308011d0c
--- /dev/null
+++ b/emulators/simh/files/patch-I1401_i1401__cd.c
@@ -0,0 +1,11 @@
+--- I1401/i1401_cd.c.orig 2016-12-01 22:43:42 UTC
++++ I1401/i1401_cd.c
+@@ -184,7 +184,7 @@ t_stat r;
+
+ if (sim_is_active (&cdr_unit)) { /* busy? */
+ sim_cancel (&cdr_unit); /* cancel */
+- if (r = cdr_svc (&cdr_unit)) /* process */
++ if ((r = cdr_svc (&cdr_unit))) /* process */
+ return r;
+ }
+ if ((cdr_unit.flags & UNIT_ATT) == 0) /* attached? */
diff --git a/emulators/simh/files/patch-I1401_i1401__cpu.c b/emulators/simh/files/patch-I1401_i1401__cpu.c
new file mode 100644
index 000000000000..326905b6774a
--- /dev/null
+++ b/emulators/simh/files/patch-I1401_i1401__cpu.c
@@ -0,0 +1,104 @@
+--- I1401/i1401_cpu.c.orig 2016-12-01 22:43:42 UTC
++++ I1401/i1401_cpu.c
+@@ -547,7 +547,7 @@ while (reason == 0) {
+
+ saved_IS = IS; /* commit prev instr */
+ if (sim_interval <= 0) { /* check clock queue */
+- if (reason = sim_process_event ())
++ if ((reason = sim_process_event ()))
+ break;
+ }
+
+@@ -1039,7 +1039,7 @@ CHECK_LENGTH:
+ */
+
+ case OP_R: /* read */
+- if (reason = iomod (ilnt, D, r_mod)) /* valid modifier? */
++ if ((reason = iomod (ilnt, D, r_mod))) /* valid modifier? */
+ break;
+ reason = read_card (ilnt, D); /* read card */
+ BS = CDR_BUF + CDR_WIDTH;
+@@ -1049,7 +1049,7 @@ CHECK_LENGTH:
+ break;
+
+ case OP_W: /* write */
+- if (reason = iomod (ilnt, D, w_mod)) /* valid modifier? */
++ if ((reason = iomod (ilnt, D, w_mod))) /* valid modifier? */
+ break;
+ reason = write_line (ilnt, D); /* print line */
+ BS = LPT_BUF + LPT_WIDTH;
+@@ -1059,7 +1059,7 @@ CHECK_LENGTH:
+ break;
+
+ case OP_P: /* punch */
+- if (reason = iomod (ilnt, D, p_mod)) /* valid modifier? */
++ if ((reason = iomod (ilnt, D, p_mod))) /* valid modifier? */
+ break;
+ reason = punch_card (ilnt, D); /* punch card */
+ BS = CDP_BUF + CDP_WIDTH;
+@@ -1069,7 +1069,7 @@ CHECK_LENGTH:
+ break;
+
+ case OP_WR: /* write and read */
+- if (reason = iomod (ilnt, D, w_mod)) /* valid modifier? */
++ if ((reason = iomod (ilnt, D, w_mod))) /* valid modifier? */
+ break;
+ reason = write_line (ilnt, D); /* print line */
+ r1 = read_card (ilnt, D); /* read card */
+@@ -1082,7 +1082,7 @@ CHECK_LENGTH:
+ break;
+
+ case OP_WP: /* write and punch */
+- if (reason = iomod (ilnt, D, w_mod)) /* valid modifier? */
++ if ((reason = iomod (ilnt, D, w_mod))) /* valid modifier? */
+ break;
+ reason = write_line (ilnt, D); /* print line */
+ r1 = punch_card (ilnt, D); /* punch card */
+@@ -1095,7 +1095,7 @@ CHECK_LENGTH:
+ break;
+
+ case OP_RP: /* read and punch */
+- if (reason = iomod (ilnt, D, NULL)) /* valid modifier? */
++ if ((reason = iomod (ilnt, D, NULL))) /* valid modifier? */
+ break;
+ reason = read_card (ilnt, D); /* read card */
+ r1 = punch_card (ilnt, D); /* punch card */
+@@ -1108,7 +1108,7 @@ CHECK_LENGTH:
+ break;
+
+ case OP_WRP: /* write, read, punch */
+- if (reason = iomod (ilnt, D, w_mod)) /* valid modifier? */
++ if ((reason = iomod (ilnt, D, w_mod))) /* valid modifier? */
+ break;
+ reason = write_line (ilnt, D); /* print line */
+ r1 = read_card (ilnt, D); /* read card */
+@@ -1122,9 +1122,9 @@ CHECK_LENGTH:
+ break;
+
+ case OP_SS: /* select stacker */
+- if (reason = iomod (ilnt, D, ss_mod)) /* valid modifier? */
++ if ((reason = iomod (ilnt, D, ss_mod))) /* valid modifier? */
+ break;
+- if (reason = select_stack (D)) /* sel stack, error? */
++ if ((reason = select_stack (D))) /* sel stack, error? */
+ break;
+ if ((ilnt == 4) || (ilnt == 5)) { /* check for branch */
+ BRANCH;
+@@ -1132,7 +1132,7 @@ CHECK_LENGTH:
+ break;
+
+ case OP_CC: /* carriage control */
+- if (reason = carriage_control (D)) /* car ctrl, error? */
++ if ((reason = carriage_control (D))) /* car ctrl, error? */
+ break;
+ if ((ilnt == 4) || (ilnt == 5)) { /* check for branch */
+ BRANCH;
+@@ -1154,7 +1154,7 @@ CHECK_LENGTH:
+ reason = STOP_INVL;
+ else if (ioind != BCD_PERCNT) /* valid dev addr? */
+ reason = STOP_INVA;
+- else if (reason = iomod (ilnt, D, mtf_mod)) /* valid modifier? */
++ else if ((reason = iomod (ilnt, D, mtf_mod))) /* valid modifier? */
+ break;
+ if (dev == IO_MT) /* BCD? */
+ reason = mt_func (unit, 0, D);
diff --git a/emulators/simh/files/patch-I1401_i1401__dp.c b/emulators/simh/files/patch-I1401_i1401__dp.c
new file mode 100644
index 000000000000..85075cc83bcd
--- /dev/null
+++ b/emulators/simh/files/patch-I1401_i1401__dp.c
@@ -0,0 +1,60 @@
+--- I1401/i1401_dp.c.orig 2016-12-01 22:43:42 UTC
++++ I1401/i1401_dp.c
+@@ -269,7 +269,7 @@ switch (fnc) {
+ for (;;) { /* loop */
+ qzr = (--cnt == 0); /* set zero latch */
+ dp_cvt_bin (dcf + DCF_CNT, DCF_CNT_LEN, cnt, MD_WM); /* redo count */
+- if (r = dp_rdsec (uptr, psec, flg, qwc)) /* read sector */
++ if ((r = dp_rdsec (uptr, psec, flg, qwc))) /* read sector */
+ break;
+ cnt = dp_get_cnt (dcf); /* get new count */
+ if (cnt < 0) /* bad count? */
+@@ -278,7 +278,7 @@ switch (fnc) {
+ break;
+ sec++; psec++; /* next sector */
+ dp_cvt_bin (dcf + DCF_SEC, DCF_SEC_LEN, sec, flg); /* rewr sec */
+- if (r = dp_nexsec (uptr, psec, dcf)) /* find next */
++ if ((r = dp_nexsec (uptr, psec, dcf))) /* find next */
+ break;
+ }
+ break; /* done, clean up */
+@@ -289,9 +289,9 @@ switch (fnc) {
+ for (;;) { /* loop */
+ qzr = (--cnt == 0); /* set zero latch */
+ dp_cvt_bin (dcf + DCF_CNT, DCF_CNT_LEN, cnt, MD_WM); /* redo count */
+- if (r = dp_rdadr (uptr, psec, flg, qwc)) /* read addr */
++ if ((r = dp_rdadr (uptr, psec, flg, qwc))) /* read addr */
+ break; /* error? */
+- if (r = dp_rdsec (uptr, psec, flg, qwc)) /* read data */
++ if ((r = dp_rdsec (uptr, psec, flg, qwc))) /* read data */
+ break; /* error? */
+ cnt = dp_get_cnt (dcf); /* get new count */
+ if (cnt < 0) /* bad count? */
+@@ -312,13 +312,13 @@ switch (fnc) {
+ for (;;) { /* loop */
+ qzr = (--cnt == 0); /* set zero latch */
+ dp_cvt_bin (dcf + DCF_CNT, DCF_CNT_LEN, cnt, MD_WM); /* rewr cnt */
+- if (r = dp_wrsec (uptr, psec, flg)) /* write data */
++ if ((r = dp_wrsec (uptr, psec, flg))) /* write data */
+ break;
+ if (qzr) /* zero latch? done */
+ break;
+ sec++; psec++; /* next sector */
+ dp_cvt_bin (dcf + DCF_SEC, DCF_SEC_LEN, sec, flg); /* rewr sec */
+- if (r = dp_nexsec (uptr, psec, dcf)) /* find next */
++ if ((r = dp_nexsec (uptr, psec, dcf))) /* find next */
+ break;
+ }
+ break; /* done, clean up */
+@@ -331,9 +331,9 @@ switch (fnc) {
+ for (;;) { /* loop */
+ qzr = (--cnt == 0); /* set zero latch */
+ dp_cvt_bin (dcf + DCF_CNT, DCF_CNT_LEN, cnt, MD_WM); /* redo count */
+- if (r = dp_wradr (uptr, psec, flg)) /* write addr */
++ if ((r = dp_wradr (uptr, psec, flg))) /* write addr */
+ break;
+- if (r = dp_wrsec (uptr, psec, flg)) /* write data */
++ if ((r = dp_wrsec (uptr, psec, flg))) /* write data */
+ break;
+ if (qzr) /* zero latch? done */
+ break;
diff --git a/emulators/simh/files/patch-I1401_i1401__mt.c b/emulators/simh/files/patch-I1401_i1401__mt.c
new file mode 100644
index 000000000000..6da42b37a12c
--- /dev/null
+++ b/emulators/simh/files/patch-I1401_i1401__mt.c
@@ -0,0 +1,11 @@
+--- I1401/i1401_mt.c.orig 2016-12-01 22:43:42 UTC
++++ I1401/i1401_mt.c
+@@ -451,7 +451,7 @@ int32 i;
+ UNIT *uptr;
+
+ for (i = 0; i < MT_NUMDR; i++) { /* per drive resets */
+- if (uptr = mt_sel_unit (i)) {
++ if ((uptr = mt_sel_unit (i))) {
+ MT_CLR_PNU (uptr); /* clear pos flag */
+ }
+ }
diff --git a/emulators/simh/files/patch-I1620_i1620__cpu.c b/emulators/simh/files/patch-I1620_i1620__cpu.c
new file mode 100644
index 000000000000..3e4bd5561769
--- /dev/null
+++ b/emulators/simh/files/patch-I1620_i1620__cpu.c
@@ -0,0 +1,11 @@
+--- I1620/i1620_cpu.c.orig 2016-12-01 22:43:42 UTC
++++ I1620/i1620_cpu.c
+@@ -476,7 +476,7 @@ while (reason == 0) {
+
+ saved_PC = PC; /* commit prev instr */
+ if (sim_interval <= 0) { /* check clock queue */
+- if (reason = sim_process_event ())
++ if ((reason = sim_process_event ()))
+ break;
+ }
+
diff --git a/emulators/simh/files/patch-I1620_i1620__dp.c b/emulators/simh/files/patch-I1620_i1620__dp.c
new file mode 100644
index 000000000000..152f287af4f5
--- /dev/null
+++ b/emulators/simh/files/patch-I1620_i1620__dp.c
@@ -0,0 +1,50 @@
+--- I1620/i1620_dp.c.orig 2016-12-01 22:43:42 UTC
++++ I1620/i1620_dp.c
+@@ -206,7 +206,7 @@ switch (f1 & ~(FNC_WCH | FNC_NRL)) {
+ if (psec < 0) /* error? */
+ CRETIOE (dp_stop, STOP_DACERR);
+ do { /* loop on count */
+- if (r = dp_rdsec (uptr, psec, qnr, qwc)) /* read sector */
++ if ((r = dp_rdsec (uptr, psec, qnr, qwc))) /* read sector */
+ break;
+ sec++; psec++; /* next sector */
+ } while ((--cnt > 0) &&
+@@ -216,9 +216,9 @@ switch (f1 & ~(FNC_WCH | FNC_NRL)) {
+ case FNC_TRK: /* read track */
+ psec = dp_trkop (drv, sec); /* start of track */
+ for (cnt = 0; cnt < DP_NUMSC; cnt++) { /* full track */
+- if (r = dp_rdadr (uptr, psec, qnr, qwc)) /* read addr */
++ if ((r = dp_rdadr (uptr, psec, qnr, qwc))) /* read addr */
+ break; /* error? */
+- if (r = dp_rdsec (uptr, psec, qnr, qwc)) /* read data */
++ if ((r = dp_rdsec (uptr, psec, qnr, qwc))) /* read data */
+ break; /* error? */
+ psec = dp_trkop (drv, sec) + ((psec + 1) % DP_NUMSC);
+ }
+@@ -231,9 +231,9 @@ switch (f1 & ~(FNC_WCH | FNC_NRL)) {
+ if (psec < 0) /* error? */
+ CRETIOE (dp_stop, STOP_DACERR);
+ do { /* loop on count */
+- if (r = dp_tstgm (M[dp_ba], qnr)) /* start with gm? */
++ if ((r = dp_tstgm (M[dp_ba], qnr))) /* start with gm? */
+ break;
+- if (r = dp_wrsec (uptr, psec, qnr)) /* write data */
++ if ((r = dp_wrsec (uptr, psec, qnr))) /* write data */
+ break;
+ sec++; psec++; /* next sector */
+ } while ((--cnt > 0) &&
+@@ -245,11 +245,11 @@ switch (f1 & ~(FNC_WCH | FNC_NRL)) {
+ return STOP_WRADIS;
+ psec = dp_trkop (drv, sec); /* start of track */
+ for (cnt = 0; cnt < DP_NUMSC; cnt++) { /* full track */
+- if (r = dp_tstgm (M[dp_ba], qnr)) /* start with gm? */
++ if ((r = dp_tstgm (M[dp_ba], qnr))) /* start with gm? */
+ break;
+- if (r = dp_wradr (uptr, psec, qnr)) /* write addr */
++ if ((r = dp_wradr (uptr, psec, qnr))) /* write addr */
+ break;
+- if (r = dp_wrsec (uptr, psec, qnr)) /* write data */
++ if ((r = dp_wrsec (uptr, psec, qnr))) /* write data */
+ break;
+ psec = dp_trkop (drv, sec) + ((psec + 1) % DP_NUMSC);
+ }
diff --git a/emulators/simh/files/patch-I1620_i1620__sys.c b/emulators/simh/files/patch-I1620_i1620__sys.c
new file mode 100644
index 000000000000..f6c38fed5af8
--- /dev/null
+++ b/emulators/simh/files/patch-I1620_i1620__sys.c
@@ -0,0 +1,11 @@
+--- I1620/i1620_sys.c.orig 2016-12-01 22:43:42 UTC
++++ I1620/i1620_sys.c
+@@ -552,7 +552,7 @@ if (I_GETQP (opfl) != I_M_QNP) {
+
+ cptr = get_glyph (cptr, fptr = gbuf, ' '); /* get flag field */
+ last = -1; /* none yet */
+-while (t = *fptr++) { /* loop through */
++while ((t = *fptr++)) { /* loop through */
+ if ((t < '0') || (t > '9')) /* must be digit */
+ return SCPE_ARG;
+ t = t - '0'; /* convert */
diff --git a/emulators/simh/files/patch-I1620_i1620__tty.c b/emulators/simh/files/patch-I1620_i1620__tty.c
new file mode 100644
index 000000000000..f23f358325f7
--- /dev/null
+++ b/emulators/simh/files/patch-I1620_i1620__tty.c
@@ -0,0 +1,11 @@
+--- I1620/i1620_tty.c.orig 2016-12-01 22:43:42 UTC
++++ I1620/i1620_tty.c
+@@ -260,7 +260,7 @@ do {
+ *c = 0x7F;
+ else if ((raw == '~') || (raw == '`')) /* flag? mark */
+ flg = FLAG;
+- else if (cp = strchr (tti_to_num, raw)) /* legal? */
++ else if ((cp = strchr (tti_to_num, raw))) /* legal? */
+ *c = ((int8) (cp - tti_to_num)) | flg; /* assemble char */
+ else raw = 007; /* beep! */
+ tto_write (raw); /* echo */
diff --git a/emulators/simh/files/patch-I7094_i7094__com.c b/emulators/simh/files/patch-I7094_i7094__com.c
new file mode 100644
index 000000000000..c5a6c21c2845
--- /dev/null
+++ b/emulators/simh/files/patch-I7094_i7094__com.c
@@ -0,0 +1,11 @@
+--- I7094/i7094_com.c.orig 2016-12-01 22:43:42 UTC
++++ I7094/i7094_com.c
+@@ -1175,7 +1175,7 @@ char name[20];
+ ln = uptr - coml_dev.units;
+ sprintf (name, val? "Output queue %d": "Input queue %d", ln);
+ lh = val? &com_outq[ln]: &com_inpq[ln];
+-if (entc = com_show_qsumm (st, lh, name)) {
++if ((entc = com_show_qsumm (st, lh, name))) {
+ for (i = 0, next = lh->head; next != 0;
+ i++, next = com_pkt[next].next) {
+ if ((i % 8) == 0)
diff --git a/emulators/simh/files/patch-I7094_i7094__cpu.c b/emulators/simh/files/patch-I7094_i7094__cpu.c
new file mode 100644
index 000000000000..3a187bc1e4ac
--- /dev/null
+++ b/emulators/simh/files/patch-I7094_i7094__cpu.c
@@ -0,0 +1,44 @@
+--- I7094/i7094_cpu.c.orig 2016-12-01 22:43:42 UTC
++++ I7094/i7094_cpu.c
+@@ -664,14 +664,14 @@ while (reason == SCPE_OK) {
+ }
+
+ if (sim_interval <= 0) { /* intv cnt expired? */
+- if (reason = sim_process_event ()) /* process events */
++ if ((reason = sim_process_event ())) /* process events */
+ break;
+ chtr_pend = chtr_eval (NULL); /* eval chan traps */
+ }
+
+ for (i = 0; ch_req && (i < NUM_CHAN); i++) { /* loop thru channels */
+ if (ch_req & REQ_CH (i)) { /* channel request? */
+- if (reason = ch_proc (i))
++ if ((reason = ch_proc (i)))
+ break;
+ }
+ chtr_pend = chtr_eval (NULL);
+@@ -1973,13 +1973,13 @@ while (reason == SCPE_OK) {
+ t_stat r;
+ for (i = 0; (i < HALT_IO_LIMIT) && !ch_qidle (); i++) {
+ sim_interval = 0;
+- if (r = sim_process_event ()) /* process events */
++ if ((r = sim_process_event ())) /* process events */
+ return r;
+ chtr_pend = chtr_eval (NULL); /* eval chan traps */
+ while (ch_req) { /* until no ch req */
+ for (j = 0; j < NUM_CHAN; j++) { /* loop thru channels */
+ if (ch_req & REQ_CH (j)) { /* channel request? */
+- if (r = ch_proc (j))
++ if ((r = ch_proc (j)))
+ return r;
+ }
+ chtr_pend = chtr_eval (NULL);
+@@ -2438,7 +2438,7 @@ if (pc & HIST_PC) {
+ }
+ fputc ('\n', st); /* end line */
+ } /* end if instruction */
+-else if (ch = HIST_CH (pc)) { /* channel? */
++else if ((ch = HIST_CH (pc))) { /* channel? */
+ fprintf (st, "CH%c ", 'A' + ch - 1);
+ fprintf (st, "%05o ", pc & AMASK);
+ fputs (" ", st);
diff --git a/emulators/simh/files/patch-I7094_i7094__dsk.c b/emulators/simh/files/patch-I7094_i7094__dsk.c
new file mode 100644
index 000000000000..654128550ec8
--- /dev/null
+++ b/emulators/simh/files/patch-I7094_i7094__dsk.c
@@ -0,0 +1,55 @@
+--- I7094/i7094_dsk.c.orig 2016-12-01 22:43:42 UTC
++++ I7094/i7094_dsk.c
+@@ -693,14 +693,14 @@ trk = uaptr->TRK;
+ switch (dsk_sta) { /* case on state */
+
+ case CHSL_RDS: /* read start */
+- if (r = dsk_init_trk (udptr, trk)) { /* read track, err? */
++ if ((r = dsk_init_trk (udptr, trk))) { /* read track, err? */
+ return ((r == ERR_NRCF)? SCPE_OK: r); /* rec not fnd ok */
+ }
+ dsk_sta = CHSL_RDS|CHSL_2ND; /* next state */
+ break;
+
+ case CHSL_RDS|CHSL_2ND: /* read data transmit */
+- if (r = dsk_xfer_done (uaptr, dtyp)) { /* transfer done? */
++ if ((r = dsk_xfer_done (uaptr, dtyp))) { /* transfer done? */
+ if (r != ERR_ENDRC) /* error? */
+ return r;
+ dsk_sta = CHSL_RDS|CHSL_3RD; /* next state */
+@@ -721,7 +721,7 @@ switch (dsk_sta) {
+ break;
+
+ case CHSL_WRS: /* write start */
+- if (r = dsk_init_trk (udptr, trk)) { /* read track, err? */
++ if ((r = dsk_init_trk (udptr, trk))) { /* read track, err? */
+ return ((r == ERR_NRCF)? SCPE_OK: r); /* rec not fnd ok */
+ }
+ ch_req |= REQ_CH (dsk_ch); /* first request */
+@@ -742,7 +742,7 @@ switch (dsk_sta) {
+ else dsk_buf[dsk_rptr++] = dsk_chob; /* write, store word */
+ if (dsk_rptr == T1STREC) /* if THA, skip after HA */
+ dsk_rptr++;
+- if (r = dsk_xfer_done (uaptr, dtyp)) { /* transfer done? */
++ if ((r = dsk_xfer_done (uaptr, dtyp))) { /* transfer done? */
+ if (r != ERR_ENDRC) /* error? */
+ return r;
+ dsk_sta = CHSL_WRS|CHSL_3RD; /* next state */
+@@ -755,7 +755,7 @@ switch (dsk_sta) {
+
+ case CHSL_WRS|CHSL_3RD: /* write done */
+ if (!dsk_wchk) { /* if write */
+- if (r = dsk_wr_trk (udptr, trk)) /* write track; err? */
++ if ((r = dsk_wr_trk (udptr, trk))) /* write track; err? */
+ return r;
+ }
+ if (dsk_qdone (dsk_ch)) /* done? exit */
+@@ -846,7 +846,7 @@ switch (dsk_sta) {
+ if (!dsk_wchk) { /* actual write? */
+ trk = trk - (trk % dsk_tab[dtyp].trkpc); /* cyl start */
+ for (i = 0; i < dsk_tab[dtyp].trkpc; i++) { /* do all tracks */
+- if (r = dsk_wr_trk (udptr, trk + i)) /* wr track; err? */
++ if ((r = dsk_wr_trk (udptr, trk + i))) /* wr track; err? */
+ return r;
+ }
+ }
diff --git a/emulators/simh/files/patch-I7094_i7094__io.c b/emulators/simh/files/patch-I7094_i7094__io.c
new file mode 100644
index 000000000000..1f1f04c3f6fc
--- /dev/null
+++ b/emulators/simh/files/patch-I7094_i7094__io.c
@@ -0,0 +1,99 @@
+--- I7094/i7094_io.c.orig 2016-12-01 22:43:42 UTC
++++ I7094/i7094_io.c
+@@ -795,7 +795,7 @@ switch (ch_sta[ch]) {
+ if (ch_dev[ch].flags & DEV_7289) { /* drum channel? */
+ ir = ReadP (clc); /* read addr */
+ ch_clc[ch] = CHAINC (clc); /* incr chan pc */
+- if (r = ch9_wr (ch, ir, 0)) /* write to dev */
++ if ((r = ch9_wr (ch, ir, 0))) /* write to dev */
+ return r;
+ }
+ else ch_clc[ch] = clc; /* set clc */
+@@ -1003,7 +1003,7 @@ if (ch_dev[ch].flags & DEV_7909) {
+ return SCPE_OK;
+
+ case CH9_SNS: /* sense */
+- if (r = ch9_sel (ch, CHSL_SNS)) /* send sense to dev */
++ if ((r = ch9_sel (ch, CHSL_SNS))) /* send sense to dev */
+ return r;
+ ch_flags[ch] |= CHF_PRD; /* prepare to read */
+ break; /* next command */
+@@ -1019,13 +1019,13 @@ if (ch_dev[ch].flags & DEV_7909) {
+ }
+ ch_flags[ch] &= ~CHF_EOR; /* clear end */
+ if (ch_op[ch] == CH9_CTLR) { /* CTLR? */
+- if (r = ch9_sel (ch, CHSL_RDS)) /* send read sel */
++ if ((r = ch9_sel (ch, CHSL_RDS))) /* send read sel */
+ return r;
+ ch_flags[ch] |= CHF_PRD; /* prep to read */
+ ch_idf[ch] = 0;
+ }
+ else if (ch_op[ch] == CH9_CTLW) { /* CTLW? */
+- if (r = ch9_sel (ch, CHSL_WRS)) /* end write sel */
++ if ((r = ch9_sel (ch, CHSL_WRS))) /* end write sel */
+ return r;
+ ch_flags[ch] |= CHF_PWR; /* prep to write */
+ }
+@@ -1035,7 +1035,7 @@ if (ch_dev[ch].flags & DEV_7909) {
+ if ((ch_wc[ch] == 0) || (ch_flags[ch] & CHF_EOR)) { /* wc == 0 or EOR? */
+ if (ch_flags[ch] & (CHF_PRD|CHF_PWR|CHF_RDS|CHF_WRS)) {
+ ch_flags[ch] &= ~(CHF_PRD|CHF_PWR|CHF_RDS|CHF_WRS);
+- if (r = ch9_wr (ch, 0, CH9DF_STOP)) /* send stop */
++ if ((r = ch9_wr (ch, 0, CH9DF_STOP))) /* send stop */
+ return r;
+ }
+ if (ch_flags[ch] & CHF_EOR) { /* EOR? */
+@@ -1055,7 +1055,7 @@ if (ch_dev[ch].flags & DEV_7909) {
+ ch_flags[ch] &= ~CHF_EOR; /* ignore */
+ else if (ch_flags[ch] & CHF_RDS) /* read? */
+ ch9_rd_putw (ch);
+- else if (r = ch9_wr_getw (ch)) /* no, write */
++ else if ((r = ch9_wr_getw (ch))) /* no, write */
+ return r;
+ if (ch_wc[ch] == 0) /* done? get next */
+ break;
+@@ -1164,7 +1164,7 @@ else {
+
+ case CH6_IOCD: /* IOCD */
+ if (ch_wc[ch]) { /* wc > 0? */
+- if (r = ch6_wr_getw (ch, TRUE)) /* send wd to dev; err? */
++ if ((r = ch6_wr_getw (ch, TRUE))) /* send wd to dev; err? */
+ return r;
+ if (ch_wc[ch]) /* more to do? */
+ return SCPE_OK;
+@@ -1174,7 +1174,7 @@ else {
+ case CH6_IOCP: /* IOCP */
+ case CH6_IOSP: /* IOSP */
+ if (ch_wc[ch]) { /* wc > 0? */
+- if (r = ch6_wr_getw (ch, FALSE)) /* send wd to dev; err? */
++ if ((r = ch6_wr_getw (ch, FALSE))) /* send wd to dev; err? */
+ return r;
+ if (ch_wc[ch]) /* more to do? */
+ return SCPE_OK;
+@@ -1184,7 +1184,7 @@ else {
+ case CH6_IOCT: /* IOCT */
+ case CH6_IOST: /* IOST */
+ if (ch_wc[ch]) { /* wc > 0? */
+- if (r = ch6_wr_getw (ch, FALSE)) /* send wd to dev; err? */
++ if ((r = ch6_wr_getw (ch, FALSE))) /* send wd to dev; err? */
+ return r;
+ if (ch_wc[ch]) /* more to do? */
+ return SCPE_OK;
+@@ -1193,7 +1193,7 @@ else {
+
+ case CH6_IORP: /* IORP */
+ if (!(ch_flags[ch] & CHF_EOR) && ch_wc[ch]) { /* not EOR? (cdp, lpt) */
+- if (r = ch6_wr_getw (ch, TRUE)) /* send wd to dev; err? */
++ if ((r = ch6_wr_getw (ch, TRUE))) /* send wd to dev; err? */
+ return r;
+ if (ch_wc[ch]) /* more to do? */
+ return SCPE_OK;
+@@ -1203,7 +1203,7 @@ else {
+
+ case CH6_IORT: /* IORT */
+ if (!(ch_flags[ch] & CHF_EOR) && ch_wc[ch]) { /* not EOR? (cdp, lpt) */
+- if (r = ch6_wr_getw (ch, TRUE)) /* send wd to dev; err? */
++ if ((r = ch6_wr_getw (ch, TRUE))) /* send wd to dev; err? */
+ return r;
+ if (ch_wc[ch]) /* more to do? */
+ return SCPE_OK;
diff --git a/emulators/simh/files/patch-I7094_i7094__mt.c b/emulators/simh/files/patch-I7094_i7094__mt.c
new file mode 100644
index 000000000000..bb2e69142467
--- /dev/null
+++ b/emulators/simh/files/patch-I7094_i7094__mt.c
@@ -0,0 +1,20 @@
+--- I7094/i7094_mt.c.orig 2016-12-01 22:43:42 UTC
++++ I7094/i7094_mt.c
+@@ -564,7 +564,7 @@ switch (uptr->UST) {
+ bc = chrono_rd (xb, MT_MAXFR); /* read clock */
+ else { /* real tape */
+ r = sim_tape_rdrecf (uptr, xb, &bc, MT_MAXFR); /* read record */
+- if (r = mt_map_err (uptr, r)) /* map status */
++ if ((r = mt_map_err (uptr, r))) /* map status */
+ return r;
+ if (mt_unit[ch] == 0) /* disconnected? */
+ return SCPE_OK;
+@@ -736,7 +736,7 @@ if (mt_bptr[ch]) {
+ if (xb == NULL)
+ return SCPE_IERR;
+ r = sim_tape_wrrecf (uptr, xb, mt_bptr[ch]); /* write record */
+- if (r = mt_map_err (uptr, r)) /* map error */
++ if ((r = mt_map_err (uptr, r))) /* map error */
+ return r;
+ }
+ uptr->UST = CHSL_WRS|CHSL_3RD; /* next state */
diff --git a/emulators/simh/files/patch-Ibm1130_ibm1130__cpu.c b/emulators/simh/files/patch-Ibm1130_ibm1130__cpu.c
new file mode 100644
index 000000000000..d7df01b85bc1
--- /dev/null
+++ b/emulators/simh/files/patch-Ibm1130_ibm1130__cpu.c
@@ -0,0 +1,33 @@
+--- Ibm1130/ibm1130_cpu.c.orig 2016-12-01 22:43:42 UTC
++++ Ibm1130/ibm1130_cpu.c
+@@ -768,7 +768,7 @@ t_stat sim_instr (void)
+ CCC--;
+ }
+ C = (CCC != 0);
+- WriteIndex(TAG, ReadIndex(TAG) & 0xFF00 | CCC); /* put 6 bits back into low byte of index register */
++ WriteIndex(TAG, (ReadIndex(TAG) & 0xFF00) | CCC); /* put 6 bits back into low byte of index register */
+ break;
+ }
+ /* if TAG == 0, fall through and treat like normal shift SLT */
+@@ -814,8 +814,8 @@ t_stat sim_instr (void)
+ while (CCC > 0) {
+ xbit = (ACC & 0x0001) << 15;
+ abit = (ACC & 0x8000);
+- ACC = (ACC >> 1) & 0x7FFF | abit;
+- EXT = (EXT >> 1) & 0x7FFF | xbit;
++ ACC = ((ACC >> 1) & 0x7FFF) | abit;
++ EXT = ((EXT >> 1) & 0x7FFF) | xbit;
+ CCC--;
+ }
+ break;
+@@ -824,8 +824,8 @@ t_stat sim_instr (void)
+ while (CCC > 0) {
+ abit = (EXT & 0x0001) << 15;
+ xbit = (ACC & 0x0001) << 15;
+- ACC = (ACC >> 1) & 0x7FFF | abit;
+- EXT = (EXT >> 1) & 0x7FFF | xbit;
++ ACC = ((ACC >> 1) & 0x7FFF) | abit;
++ EXT = ((EXT >> 1) & 0x7FFF) | xbit;
+ CCC--;
+ }
+ break;
diff --git a/emulators/simh/files/patch-Interdata_id16__cpu.c b/emulators/simh/files/patch-Interdata_id16__cpu.c
new file mode 100644
index 000000000000..857307afab8b
--- /dev/null
+++ b/emulators/simh/files/patch-Interdata_id16__cpu.c
@@ -0,0 +1,11 @@
+--- Interdata/id16_cpu.c.orig 2016-12-01 22:43:42 UTC
++++ Interdata/id16_cpu.c
+@@ -604,7 +604,7 @@ while (reason == 0) {
+ int32 sr, st;
+
+ if (sim_interval <= 0) { /* check clock queue */
+- if (reason = sim_process_event ())
++ if ((reason = sim_process_event ()))
+ break;
+ int_eval ();
+ }
diff --git a/emulators/simh/files/patch-Interdata_id32__cpu.c b/emulators/simh/files/patch-Interdata_id32__cpu.c
new file mode 100644
index 000000000000..55f4d77c0309
--- /dev/null
+++ b/emulators/simh/files/patch-Interdata_id32__cpu.c
@@ -0,0 +1,11 @@
+--- Interdata/id32_cpu.c.orig 2016-12-01 22:43:42 UTC
++++ Interdata/id32_cpu.c
+@@ -664,7 +664,7 @@ while (reason == 0) {
+ int32 sr, st;
+
+ if (sim_interval <= 0) { /* check clock queue */
+- if (reason = sim_process_event ())
++ if ((reason = sim_process_event ()))
+ break;
+ int_eval ();
+ }
diff --git a/emulators/simh/files/patch-Interdata_id__dp.c b/emulators/simh/files/patch-Interdata_id__dp.c
new file mode 100644
index 000000000000..c7e44ef8d5c6
--- /dev/null
+++ b/emulators/simh/files/patch-Interdata_id__dp.c
@@ -0,0 +1,20 @@
+--- Interdata/id_dp.c.orig 2016-12-01 22:43:42 UTC
++++ Interdata/id_dp.c
+@@ -419,7 +419,7 @@ switch (dp_cmd & 0x7) {
+ if (sch_actv (dp_dib.sch, dp_dib.dno)) { /* sch transfer? */
+ if (dp_dter (uptr, dp_1st)) /* check xfr err */
+ return SCPE_OK;
+- if (r = dp_rds (uptr)) /* read sec, err? */
++ if ((r = dp_rds (uptr))) /* read sec, err? */
+ return r;
+ dp_1st = 0;
+ t = sch_wrmem (dp_dib.sch, dpxb, DP_NUMBY); /* write to memory */
+@@ -438,7 +438,7 @@ switch (dp_cmd & 0x7) {
+ return SCPE_OK;
+ dp_bptr = sch_rdmem (dp_dib.sch, dpxb, DP_NUMBY); /* read from mem */
+ dp_db = dpxb[dp_bptr - 1]; /* last byte */
+- if (r = dp_wds (uptr)) /* write sec, err? */
++ if ((r = dp_wds (uptr))) /* write sec, err? */
+ return r;
+ dp_1st = 0;
+ if (sch_actv (dp_dib.sch, dp_dib.dno)) { /* more to do? */
diff --git a/emulators/simh/files/patch-Interdata_id__idc.c b/emulators/simh/files/patch-Interdata_id__idc.c
new file mode 100644
index 000000000000..e3bb56eab1a2
--- /dev/null
+++ b/emulators/simh/files/patch-Interdata_id__idc.c
@@ -0,0 +1,20 @@
+--- Interdata/id_idc.c.orig 2016-12-01 22:43:42 UTC
++++ Interdata/id_idc.c
+@@ -576,7 +576,7 @@ switch (uptr->FNC & CMC_MASK) {
+ if (sch_actv (idc_dib.sch, idc_dib.dno)) { /* sch transfer? */
+ if (idc_dter (uptr, idc_1st)) /* dte? done */
+ return SCPE_OK;
+- if (r = idc_rds (uptr)) /* read sec, err? */
++ if ((r = idc_rds (uptr))) /* read sec, err? */
+ return r;
+ idc_1st = 0;
+ t = sch_wrmem (idc_dib.sch, idcxb, IDC_NUMBY); /* write mem */
+@@ -595,7 +595,7 @@ switch (uptr->FNC & CMC_MASK) {
+ return SCPE_OK;
+ idc_bptr = sch_rdmem (idc_dib.sch, idcxb, IDC_NUMBY); /* read mem */
+ idc_db = idcxb[idc_bptr - 1]; /* last byte */
+- if (r = idc_wds (uptr)) /* write sec, err? */
++ if ((r = idc_wds (uptr))) /* write sec, err? */
+ return r;
+ idc_1st = 0;
+ if (sch_actv (idc_dib.sch, idc_dib.dno)) { /* more to do? */
diff --git a/emulators/simh/files/patch-Interdata_id__io.c b/emulators/simh/files/patch-Interdata_id__io.c
new file mode 100644
index 000000000000..0fc0d7f1ab35
--- /dev/null
+++ b/emulators/simh/files/patch-Interdata_id__io.c
@@ -0,0 +1,29 @@
+--- Interdata/id_io.c.orig 2016-12-01 22:43:42 UTC
++++ Interdata/id_io.c
+@@ -358,7 +358,7 @@ if ((r != SCPE_OK) || (newmax == sch_max
+ if (newmax == 0) /* must be > 0 */
+ return SCPE_ARG;
+ if (newmax < sch_max) { /* reducing? */
+- for (i = 0; dptr = sim_devices[i]; i++) { /* loop thru dev */
++ for (i = 0; (dptr = sim_devices[i]); i++) { /* loop thru dev */
+ dibp = (DIB *) dptr->ctxt; /* get DIB */
+ if (dibp && (dibp->sch >= (int32) newmax)) { /* dev using chan? */
+ printf ("Device %02X uses channel %d\n",
+@@ -439,7 +439,7 @@ int32 i, j, t;
+ uint32 r;
+
+ for (i = t = 0; i < INTSZ; i++) { /* loop thru array */
+- if (r = int_req[i] & int_enb[i]) { /* find nz int wd */
++ if ((r = int_req[i] & int_enb[i])) { /* find nz int wd */
+ for (j = 0; j < 32; t++, j++) {
+ if (r & (1u << j)) {
+ int_req[i] = int_req[i] & ~(1u << j); /* clr request */
+@@ -630,7 +630,7 @@ for (i = 0; i < (DEVNO / 32); i++)
+
+ /* Test each device for conflict; add to map; init tables */
+
+-for (i = 0; dptr = sim_devices[i]; i++) { /* loop thru devices */
++for (i = 0; (dptr = sim_devices[i]); i++) { /* loop thru devices */
+ dibp = (DIB *) dptr->ctxt; /* get DIB */
+ if ((dibp == NULL) || (dptr->flags & DEV_DIS)) /* exist, enabled? */
+ continue;
diff --git a/emulators/simh/files/patch-Interdata_id__mt.c b/emulators/simh/files/patch-Interdata_id__mt.c
new file mode 100644
index 000000000000..e550b83c8a70
--- /dev/null
+++ b/emulators/simh/files/patch-Interdata_id__mt.c
@@ -0,0 +1,27 @@
+--- Interdata/id_mt.c.orig 2016-12-01 22:43:42 UTC
++++ Interdata/id_mt.c
+@@ -368,13 +368,13 @@ switch (uptr->UCMD) {
+ }
+
+ if (mt_bptr) { /* any chars? */
+- if (st = sim_tape_wrrecf (uptr, mtxb, mt_bptr)) /* write, err? */
++ if ((st = sim_tape_wrrecf (uptr, mtxb, mt_bptr))) /* write, err? */
+ r = mt_map_err (uptr, st); /* map error */
+ }
+ break; /* record done */
+
+ case MTC_WEOF: /* write eof */
+- if (st = sim_tape_wrtmk (uptr)) /* write tmk, err? */
++ if ((st = sim_tape_wrtmk (uptr))) /* write tmk, err? */
+ r = mt_map_err (uptr, st); /* map error */
+ mt_sta = mt_sta | STA_EOF; /* set eof */
+ if (mt_arm[u]) /* set intr */
+@@ -402,7 +402,7 @@ switch (uptr->UCMD) {
+ break;
+
+ case MTC_SPCR: /* backspace */
+- if (st = sim_tape_sprecr (uptr, &tbc)) /* skip rec rev, err? */
++ if ((st = sim_tape_sprecr (uptr, &tbc))) /* skip rec rev, err? */
+ r = mt_map_err (uptr, st); /* map error */
+ break;
+ } /* end case */
diff --git a/emulators/simh/files/patch-Interdata_id__pas.c b/emulators/simh/files/patch-Interdata_id__pas.c
new file mode 100644
index 000000000000..528e7a514e5b
--- /dev/null
+++ b/emulators/simh/files/patch-Interdata_id__pas.c
@@ -0,0 +1,11 @@
+--- Interdata/id_pas.c.orig 2016-12-01 22:43:42 UTC
++++ Interdata/id_pas.c
+@@ -334,7 +334,7 @@ if (ln >= 0) {
+ tmxr_poll_rx (&pas_desc); /* poll for input */
+ for (ln = 0; ln < PAS_ENAB; ln++) { /* loop thru lines */
+ if (pas_ldsc[ln].conn) { /* connected? */
+- if (c = tmxr_getc_ln (&pas_ldsc[ln])) { /* any char? */
++ if ((c = tmxr_getc_ln (&pas_ldsc[ln]))) { /* any char? */
+ pas_sta[ln] = pas_sta[ln] & ~(STA_FR | STA_PF);
+ if (pas_rchp[ln])
+ pas_sta[ln] = pas_sta[ln] | STA_OVR;
diff --git a/emulators/simh/files/patch-LGP_lgp__cpu.c b/emulators/simh/files/patch-LGP_lgp__cpu.c
new file mode 100644
index 000000000000..82e294459a29
--- /dev/null
+++ b/emulators/simh/files/patch-LGP_lgp__cpu.c
@@ -0,0 +1,29 @@
+--- LGP/lgp_cpu.c.orig 2016-12-01 22:43:42 UTC
++++ LGP/lgp_cpu.c
+@@ -288,7 +288,7 @@ if (lgp21_sov) {
+
+ do {
+ if (sim_interval <= 0) { /* check clock queue */
+- if (r = sim_process_event ())
++ if ((r = sim_process_event ()))
+ break;
+ }
+
+@@ -308,7 +308,7 @@ do {
+ PC = (PC + 1) & AMASK; /* increment PC */
+ sim_interval = sim_interval - 1;
+
+- if (r = cpu_one_inst (oPC, IR)) { /* one instr; error? */
++ if ((r = cpu_one_inst (oPC, IR))) { /* one instr; error? */
+ if (r == STOP_STALL) { /* stall? */
+ PC = oPC; /* back up PC */
+ delay = r = 0; /* no delay */
+@@ -744,7 +744,7 @@ if (cptr) {
+ else inst = IR;
+ while ((r = cpu_one_inst (PC, inst)) == STOP_STALL) {
+ sim_interval = 0;
+- if (r = sim_process_event ())
++ if ((r = sim_process_event ()))
+ return r;
+ }
+ return r;
diff --git a/emulators/simh/files/patch-LGP_lgp__stddev.c b/emulators/simh/files/patch-LGP_lgp__stddev.c
new file mode 100644
index 000000000000..7f4e12cb6066
--- /dev/null
+++ b/emulators/simh/files/patch-LGP_lgp__stddev.c
@@ -0,0 +1,29 @@
+--- LGP/lgp_stddev.c.orig 2016-12-01 22:43:42 UTC
++++ LGP/lgp_stddev.c
+@@ -394,7 +394,7 @@ t_stat ttr_svc (UNIT *uptr)
+ {
+ t_stat r;
+
+-if (r = read_reader (uptr, ttr_stopioe, (int32 *) &tti_buf))
++if ((r = read_reader (uptr, ttr_stopioe, (int32 *) &tti_buf)))
+ return r;
+ if (!(uptr->flags & UNIT_NOCS) && /* cstop enable? */
+ (tti_buf == FLEX_CSTOP)) /* cond stop? */
+@@ -415,7 +415,7 @@ t_stat ptr_svc (UNIT *uptr)
+ {
+ t_stat r;
+
+-if (r = read_reader (uptr, ptr_stopioe, &uptr->buf))
++if ((r = read_reader (uptr, ptr_stopioe, &uptr->buf)))
+ return r;
+ if (uptr->buf == FLEX_CSTOP) /* cond stop? */
+ inp_done = 1;
+@@ -548,7 +548,7 @@ else {
+ ch = '\b';
+ else ch = flex_to_ascii[flex | (tto_uc << 6)]; /* cvt flex to ascii */
+ if (ch > 0) { /* legit? */
+- if (r = sim_putchar_s (ch)) /* write char */
++ if ((r = sim_putchar_s (ch))) /* write char */
+ return r;
+ tto_unit[0].pos = tto_unit[0].pos + 1;
+ if (flex == FLEX_CR) { /* cr? */
diff --git a/emulators/simh/files/patch-LGP_lgp__sys.c b/emulators/simh/files/patch-LGP_lgp__sys.c
new file mode 100644
index 000000000000..58112fcc8924
--- /dev/null
+++ b/emulators/simh/files/patch-LGP_lgp__sys.c
@@ -0,0 +1,20 @@
+--- LGP/lgp_sys.c.orig 2016-12-01 22:43:42 UTC
++++ LGP/lgp_sys.c
+@@ -363,7 +363,7 @@ if ((sw & SWMASK ('L')) ||
+ return SCPE_OK;
+ if (islower (c))
+ c = toupper (c);
+- if (tptr = strchr (hex_decode, c))
++ if ((tptr = strchr (hex_decode, c)))
+ val[0] = (val[0] << 4) | (tptr - hex_decode);
+ else return SCPE_ARG;
+ }
+@@ -388,7 +388,7 @@ else sgn = 0;
+ cptr = get_glyph (cptr, gbuf, 0); /* get opcode */
+ if (gbuf[1] != 0)
+ return SCPE_ARG;
+-if (tptr = strchr (opcode, gbuf[0]))
++if ((tptr = strchr (opcode, gbuf[0])))
+ val[0] = ((tptr - opcode) << I_V_OP) | sgn; /* merge opcode */
+ else return SCPE_ARG;
+ cptr = get_glyph (cptr, gbuf, 0); /* get address */
diff --git a/emulators/simh/files/patch-NOVA_eclipse__cpu.c b/emulators/simh/files/patch-NOVA_eclipse__cpu.c
new file mode 100644
index 000000000000..d691e18be148
--- /dev/null
+++ b/emulators/simh/files/patch-NOVA_eclipse__cpu.c
@@ -0,0 +1,11 @@
+--- NOVA/eclipse_cpu.c.orig 2016-12-01 22:43:42 UTC
++++ NOVA/eclipse_cpu.c
+@@ -744,7 +744,7 @@ if (MapInit == 0) {
+
+ while (reason == 0) { /* loop until halted */
+ if (sim_interval <= 0) { /* check clock queue */
+- if (reason = sim_process_event ())
++ if ((reason = sim_process_event ()))
+ break;
+ }
+
diff --git a/emulators/simh/files/patch-NOVA_nova__cpu.c b/emulators/simh/files/patch-NOVA_nova__cpu.c
new file mode 100644
index 000000000000..6f98e78c7490
--- /dev/null
+++ b/emulators/simh/files/patch-NOVA_nova__cpu.c
@@ -0,0 +1,16 @@
+--- NOVA/nova_cpu.c.orig 2016-12-01 22:43:42 UTC
++++ NOVA/nova_cpu.c
+@@ -243,11 +243,12 @@
+ #define STK_CHECK(x,y) if (((x) & 0377) < (y)) \
+ int_req = int_req | INT_STK
+ #define IND_STEP(x) M[x] & A_IND; /* return next level indicator */ \
+- if ( ((x) <= AUTO_TOP) && ((x) >= AUTO_INC) ) \
++ if ( ((x) <= AUTO_TOP) && ((x) >= AUTO_INC) ) { \
+ if ( (x) < AUTO_DEC ) \
+ M[x] = (M[x] + 1) & DMASK; \
+ else \
+ M[x] = (M[x] - 1) & DMASK; \
++ } \
+ x = M[x] & AMASK
+
+ #define INCREMENT_PC PC = (PC + 1) & AMASK /* increment PC */
diff --git a/emulators/simh/files/patch-NOVA_nova__dkp.c b/emulators/simh/files/patch-NOVA_nova__dkp.c
new file mode 100644
index 000000000000..ccf50d851e05
--- /dev/null
+++ b/emulators/simh/files/patch-NOVA_nova__dkp.c
@@ -0,0 +1,20 @@
+--- NOVA/nova_dkp.c.orig 2016-12-01 22:43:42 UTC
++++ NOVA/nova_dkp.c
+@@ -909,7 +909,7 @@ do {
+ if (uptr->FUNC == FCCY_READ) { /* read? */
+ awc = fxread (tbuf, sizeof(uint16), DKP_NUMWD, uptr->fileref);
+ for ( ; awc < DKP_NUMWD; awc++) tbuf[awc] = 0;
+- if (err = ferror (uptr->fileref))
++ if ((err = ferror (uptr->fileref)))
+ break;
+ for (dx = 0; dx < DKP_NUMWD; dx++) { /* loop thru buffer */
+ pa = MapAddr (dkp_map, (dkp_ma & AMASK));
+@@ -925,7 +925,7 @@ do {
+ dkp_ma = (dkp_ma + 1) & AMASK;
+ }
+ fxwrite (tbuf, sizeof(int16), DKP_NUMWD, uptr->fileref);
+- if (err = ferror (uptr->fileref))
++ if ((err = ferror (uptr->fileref)))
+ break;
+ }
+
diff --git a/emulators/simh/files/patch-NOVA_nova__mta.c b/emulators/simh/files/patch-NOVA_nova__mta.c
new file mode 100644
index 000000000000..27fce8c94fe7
--- /dev/null
+++ b/emulators/simh/files/patch-NOVA_nova__mta.c
@@ -0,0 +1,38 @@
+--- NOVA/nova_mta.c.orig 2016-12-01 22:43:42 UTC
++++ NOVA/nova_mta.c
+@@ -412,7 +412,7 @@ else switch (c) {
+ mtxb[p++] = M[pa] & 0377;
+ mta_ma = (mta_ma + 1) & AMASK;
+ }
+- if (st = sim_tape_wrrecf (uptr, mtxb, tbc)) { /* write rec, err? */
++ if ((st = sim_tape_wrrecf (uptr, mtxb, tbc))) { /* write rec, err? */
+ r = mta_map_err (uptr, st); /* map error */
+ mta_ma = (mta_ma - wc) & AMASK; /* restore wc */
+ }
+@@ -421,7 +421,7 @@ else switch (c) {
+ break;
+
+ case CU_WREOF: /* write eof */
+- if (st = sim_tape_wrtmk (uptr)) /* write tmk, err? */
++ if ((st = sim_tape_wrtmk (uptr))) /* write tmk, err? */
+ r = mta_map_err (uptr, st); /* map error */
+ else mta_upddsta (uptr, uptr->USTAT | STA_EOF | STA_RDY);
+ break;
+@@ -435,7 +435,7 @@ else switch (c) {
+ case CU_SPACEF: /* space forward */
+ do {
+ mta_wc = (mta_wc + 1) & DMASK; /* incr wc */
+- if (st = sim_tape_sprecf (uptr, &tbc)) { /* space rec fwd, err? */
++ if ((st = sim_tape_sprecf (uptr, &tbc))) { /* space rec fwd, err? */
+ r = mta_map_err (uptr, st); /* map error */
+ break;
+ }
+@@ -447,7 +447,7 @@ else switch (c) {
+ case CU_SPACER: /* space reverse */
+ do {
+ mta_wc = (mta_wc + 1) & DMASK; /* incr wc */
+- if (st = sim_tape_sprecr (uptr, &tbc)) { /* space rec rev, err? */
++ if ((st = sim_tape_sprecr (uptr, &tbc))) { /* space rec rev, err? */
+ r = mta_map_err (uptr, st); /* map error */
+ break;
+ }
diff --git a/emulators/simh/files/patch-NOVA_nova__qty.c b/emulators/simh/files/patch-NOVA_nova__qty.c
new file mode 100644
index 000000000000..cdcc0859b06e
--- /dev/null
+++ b/emulators/simh/files/patch-NOVA_nova__qty.c
@@ -0,0 +1,33 @@
+--- NOVA/nova_qty.c.orig 2016-12-01 22:43:42 UTC
++++ NOVA/nova_qty.c
+@@ -603,11 +603,12 @@ t_stat qty_common_svc( DIB * dibp, UNIT
+
+ ++qty_polls ; /* another time 'round the track */
+ newln = tmxr_poll_conn( &qty_desc ) ; /* anybody knocking at the door? */
+- if ( (newln >= 0) && qty_mdm )
++ if ( (newln >= 0) && qty_mdm ) {
+ if ( newln >= qty_max )
+ {
+ return SCPE_IERR; /* WTF - sanity check failed, over? */
+ }
++ }
+ else
+ {
+ line = newln ; /* handle modem control */
+@@ -991,7 +992,7 @@ int32 alm( int32 pulse, int32 code, int3
+ break ;
+
+ case ioDIC : /* get modem or receiver status */
+- if ( alm_line < qty_max )
++ if ( alm_line < qty_max ) {
+ if ( alm_section )
+ {
+ /* get modem section status */
+@@ -1000,6 +1001,7 @@ int32 alm( int32 pulse, int32 code, int3
+ iodata = 0035 ; /* set CD, CTS, DSR, MDM flags */
+ }
+ }
++ }
+ else
+ {
+ /* get receiver section status */
diff --git a/emulators/simh/files/patch-NOVA_nova__tt1.c b/emulators/simh/files/patch-NOVA_nova__tt1.c
new file mode 100644
index 000000000000..51067dd4610f
--- /dev/null
+++ b/emulators/simh/files/patch-NOVA_nova__tt1.c
@@ -0,0 +1,11 @@
+--- NOVA/nova_tt1.c.orig 2016-12-01 22:43:42 UTC
++++ NOVA/nova_tt1.c
+@@ -184,7 +184,7 @@ int32 temp, newln;
+
+ if (tt1_ldsc.conn) { /* connected? */
+ tmxr_poll_rx (&tt_desc); /* poll for input */
+- if (temp = tmxr_getc_ln (&tt1_ldsc)) { /* get char */
++ if ((temp = tmxr_getc_ln (&tt1_ldsc))) { /* get char */
+ uptr->buf = temp & 0177;
+ if ((uptr->flags & UNIT_DASHER) &&
+ (uptr->buf == '\r'))
diff --git a/emulators/simh/files/patch-PDP10_pdp10__cpu.c b/emulators/simh/files/patch-PDP10_pdp10__cpu.c
new file mode 100644
index 000000000000..4108daf18778
--- /dev/null
+++ b/emulators/simh/files/patch-PDP10_pdp10__cpu.c
@@ -0,0 +1,29 @@
+--- PDP10/pdp10_cpu.c.orig 2016-12-01 22:43:42 UTC
++++ PDP10/pdp10_cpu.c
+@@ -705,7 +705,7 @@ pager_tc = FALSE;
+ pflgs = 0; /* not in PXCT */
+ xct_cnt = 0; /* count XCT's */
+ if (sim_interval <= 0) { /* check clock queue */
+- if (i = sim_process_event ()) /* error? stop sim */
++ if ((i = sim_process_event ())) /* error? stop sim */
+ ABORT (i);
+ pi_eval (); /* eval pi system */
+ }
+@@ -719,7 +719,7 @@ if (sim_interval <= 0) {
+ if (qintr) {
+ int32 vec, uba;
+ pager_pi = TRUE; /* flag in pi seq */
+- if (vec = pi_ub_vec (qintr, &uba)) { /* Unibus interrupt? */
++ if ((vec = pi_ub_vec (qintr, &uba))) { /* Unibus interrupt? */
+ mb = ReadP (epta + EPT_UBIT + uba); /* get dispatch table */
+ if (mb == 0) /* invalid? stop */
+ ABORT (STOP_ZERINT);
+@@ -2019,7 +2019,7 @@ int32 test_int (void)
+ int32 t;
+
+ if (sim_interval <= 0) { /* check queue */
+- if (t = sim_process_event ()) /* IO event? */
++ if ((t = sim_process_event ())) /* IO event? */
+ return t;
+ if (pi_eval ()) /* interrupt? */
+ return (INTERRUPT);
diff --git a/emulators/simh/files/patch-PDP10_pdp10__ksio.c b/emulators/simh/files/patch-PDP10_pdp10__ksio.c
new file mode 100644
index 000000000000..c04e79fa5b44
--- /dev/null
+++ b/emulators/simh/files/patch-PDP10_pdp10__ksio.c
@@ -0,0 +1,20 @@
+--- PDP10/pdp10_ksio.c.orig 2016-12-01 22:43:42 UTC
++++ PDP10/pdp10_ksio.c
+@@ -401,7 +401,7 @@ uint32 pa = (uint32) ea;
+ int32 i, n, val;
+ DIB *dibp;
+
+-for (i = 0; dibp = dib_tab[i]; i++ ) {
++for (i = 0; (dibp = dib_tab[i]); i++ ) {
+ if ((pa >= dibp->ba) &&
+ (pa < (dibp->ba + dibp->lnt))) {
+ dibp->rd (&val, pa, READ);
+@@ -418,7 +418,7 @@ uint32 pa = (uint32) ea;
+ int32 i, n;
+ DIB *dibp;
+
+-for (i = 0; dibp = dib_tab[i]; i++ ) {
++for (i = 0; (dibp = dib_tab[i]); i++ ) {
+ if ((pa >= dibp->ba) &&
+ (pa < (dibp->ba + dibp->lnt))) {
+ dibp->wr ((int32) val, pa, mode);
diff --git a/emulators/simh/files/patch-PDP10_pdp10__lp20.c b/emulators/simh/files/patch-PDP10_pdp10__lp20.c
new file mode 100644
index 000000000000..ed6a6294a504
--- /dev/null
+++ b/emulators/simh/files/patch-PDP10_pdp10__lp20.c
@@ -0,0 +1,20 @@
+--- PDP10/pdp10_lp20.c.orig 2016-12-01 22:43:42 UTC
++++ PDP10/pdp10_lp20.c
+@@ -563,7 +563,7 @@ lp20_unit.pos = ftell (lp20_unit.fileref
+ if (dvuadv) /* update DAVFU ptr */
+ dvptr = (dvptr + cnt) % dvlnt;
+ if (davfu[dvptr] & (1 << DV_TOF)) { /* at top of form? */
+- if (lppagc = (lppagc - 1) & PAGC_MASK) { /* decr page cntr */
++ if ((lppagc = (lppagc - 1) & PAGC_MASK)) { /* decr page cntr */
+ lpcsa = lpcsa & ~CSA_PZRO; /* update status */
+ return TRUE;
+ }
+@@ -592,7 +592,7 @@ for (i = 0; i < dvlnt; i++) {
+ lp20_adv (1, FALSE);
+ fputc ('\f', lp20_unit.fileref); /* print form feed */
+ lp20_unit.pos = ftell (lp20_unit.fileref);
+- if (lppagc = (lppagc - 1) & PAGC_MASK) { /* decr page cntr */
++ if ((lppagc = (lppagc - 1) & PAGC_MASK)) { /* decr page cntr */
+ lpcsa = lpcsa & ~CSA_PZRO; /* update status */
+ return TRUE;
+ }
diff --git a/emulators/simh/files/patch-PDP10_pdp10__mdfp.c b/emulators/simh/files/patch-PDP10_pdp10__mdfp.c
new file mode 100644
index 000000000000..1652abc808d6
--- /dev/null
+++ b/emulators/simh/files/patch-PDP10_pdp10__mdfp.c
@@ -0,0 +1,11 @@
+--- PDP10/pdp10_mdfp.c.orig 2016-12-01 22:43:42 UTC
++++ PDP10/pdp10_mdfp.c
+@@ -493,7 +493,7 @@ if (a.fhi >= 2 * b.fhi) {
+ SETF (F_AOV | F_DCK | F_FOV | F_T1);
+ return FALSE;
+ }
+-if (savhi = a.fhi) { /* dvd = 0? quo = 0 */
++if ((savhi = a.fhi)) { /* dvd = 0? quo = 0 */
+ a.sign = a.sign ^ b.sign; /* result sign */
+ a.exp = a.exp - b.exp + FP_BIAS + 1; /* result exponent */
+ a.fhi = a.fhi / (b.fhi >> (FP_N_FHI + 1)); /* do divide */
diff --git a/emulators/simh/files/patch-PDP10_pdp10__rp.c b/emulators/simh/files/patch-PDP10_pdp10__rp.c
new file mode 100644
index 000000000000..5b8e39c2bd85
--- /dev/null
+++ b/emulators/simh/files/patch-PDP10_pdp10__rp.c
@@ -0,0 +1,11 @@
+--- PDP10/pdp10_rp.c.orig 2016-12-01 22:43:42 UTC
++++ PDP10/pdp10_rp.c
+@@ -951,7 +951,7 @@ switch (uptr->FUNC) {
+ if ((rpcs2 & CS2_UAI) == 0)
+ ba = ba + 4;
+ }
+- if (fc10 = twc10 & (RP_NUMWD - 1)) { /* fill? */
++ if ((fc10 = twc10 & (RP_NUMWD - 1))) { /* fill? */
+ fc10 = RP_NUMWD - fc10;
+ for (i = 0; i < fc10; i++)
+ dbuf[twc10 + i] = 0;
diff --git a/emulators/simh/files/patch-PDP10_pdp10__tu.c b/emulators/simh/files/patch-PDP10_pdp10__tu.c
new file mode 100644
index 000000000000..738c81cc9cb5
--- /dev/null
+++ b/emulators/simh/files/patch-PDP10_pdp10__tu.c
@@ -0,0 +1,56 @@
+--- PDP10/pdp10_tu.c.orig 2016-12-01 22:43:42 UTC
++++ PDP10/pdp10_tu.c
+@@ -833,7 +833,7 @@ switch (fnc) {
+ case FNC_SPACEF: /* space forward */
+ do {
+ tufc = (tufc + 1) & 0177777; /* incr fc */
+- if (st = sim_tape_sprecf (uptr, &tbc)) { /* space rec fwd, err? */
++ if ((st = sim_tape_sprecf (uptr, &tbc))) { /* space rec fwd, err? */
+ r = tu_map_err (uptr, st, 0); /* map error */
+ break;
+ }
+@@ -847,7 +847,7 @@ switch (fnc) {
+ case FNC_SPACER: /* space reverse */
+ do {
+ tufc = (tufc + 1) & 0177777; /* incr wc */
+- if (st = sim_tape_sprecr (uptr, &tbc)) { /* space rec rev, err? */
++ if ((st = sim_tape_sprecr (uptr, &tbc))) { /* space rec rev, err? */
+ r = tu_map_err (uptr, st, 0); /* map error */
+ break;
+ }
+@@ -859,7 +859,7 @@ switch (fnc) {
+ break;
+
+ case FNC_WREOF: /* write end of file */
+- if (st = sim_tape_wrtmk (uptr)) /* write tmk, err? */
++ if ((st = sim_tape_wrtmk (uptr))) /* write tmk, err? */
+ r = tu_map_err (uptr, st, 0); /* map error */
+ tufs = tufs | FS_ATA;
+ break;
+@@ -889,7 +889,7 @@ switch (fnc) {
+ if ((uptr->UDENS == TC_1600) && sim_tape_bot (uptr))
+ tufs = tufs | FS_ID; /* PE BOT? ID burst */
+ TXFR (ba, wc, 0); /* validate transfer */
+- if (st = sim_tape_rdrecf (uptr, xbuf, &tbc, MT_MAXFR)) { /* read fwd */
++ if ((st = sim_tape_rdrecf (uptr, xbuf, &tbc, MT_MAXFR))) { /* read fwd */
+ if (st == MTSE_TMK) /* TMK also sets FCE */
+ set_tuer (ER_FCE);
+ r = tu_map_err (uptr, st, 1); /* map error */
+@@ -936,7 +936,7 @@ switch (fnc) {
+ } /* end for */
+ if (j < fc) /* short record? */
+ fc = j;
+- if (st = sim_tape_wrrecf (uptr, xbuf, fc)) /* write rec, err? */
++ if ((st = sim_tape_wrrecf (uptr, xbuf, fc))) /* write rec, err? */
+ r = tu_map_err (uptr, st, 1); /* map error */
+ else {
+ tufc = (tufc + fc) & 0177777;
+@@ -951,7 +951,7 @@ switch (fnc) {
+ case FNC_WCHKR: /* wcheck = read */
+ tufc = 0; /* clear frame count */
+ TXFR (ba, wc, 1); /* validate xfer rev */
+- if (st = sim_tape_rdrecr (uptr, xbuf + 4, &tbc, MT_MAXFR)) { /* read rev */
++ if ((st = sim_tape_rdrecr (uptr, xbuf + 4, &tbc, MT_MAXFR))) { /* read rev */
+ if (st == MTSE_TMK) /* TMK also sets FCE */
+ set_tuer (ER_FCE);
+ r = tu_map_err (uptr, st, 1); /* map error */
diff --git a/emulators/simh/files/patch-PDP11_pdp11__cis.c b/emulators/simh/files/patch-PDP11_pdp11__cis.c
new file mode 100644
index 000000000000..ec79f1c00582
--- /dev/null
+++ b/emulators/simh/files/patch-PDP11_pdp11__cis.c
@@ -0,0 +1,38 @@
+--- PDP11/pdp11_cis.c.orig 2016-12-01 22:43:42 UTC
++++ PDP11/pdp11_cis.c
+@@ -1134,7 +1134,7 @@ switch (op) {
+ result = (A2ADR << 16) | A2LNT; /* op in VAX format */
+ CVTLx:
+ dst = Dstr0; /* clear result */
+- if (dst.sign = GET_SIGN_L (result))
++ if ((dst.sign = GET_SIGN_L (result)))
+ result = (~result + 1) & 0xFFFFFFFF;
+ for (i = 1; (i < (DSTRLNT * 8)) && result; i++) {
+ digit = result % 10;
+@@ -1267,7 +1267,7 @@ for (i = 0; i < DSTRLNT; i++) {
+ mask = 0xFFFFFFFF;
+ if (dst->val[i] & mask) /* test for ovflo */
+ V = 1;
+- if (dst->val[i] = dst->val[i] & ~mask) /* test nz */
++ if ((dst->val[i] = dst->val[i] & ~mask)) /* test nz */
+ Z = 0;
+ }
+ dst->sign = dst->sign & ~unsignedtab[type] & ~(Z & ~V);
+@@ -1523,7 +1523,7 @@ uint32 NibbleRshift (DSTR *dsrc, int32 s
+ {
+ int32 i, s, nc;
+
+-if (s = sc * 4) {
++if ((s = sc * 4)) {
+ for (i = DSTRMAX; i >= 0; i--) {
+ nc = (dsrc->val[i] << (32 - s)) & 0xFFFFFFFF;
+ dsrc->val[i] = ((dsrc->val[i] >> s) |
+@@ -1548,7 +1548,7 @@ int32 i, s;
+ uint32 nc, cin;
+
+ cin = 0;
+-if (s = sc * 4) {
++if ((s = sc * 4)) {
+ for (i = 0; i < DSTRLNT; i++) {
+ nc = dsrc->val[i] >> (32 - s);
+ dsrc->val[i] = ((dsrc->val[i] << s) | cin) & 0xFFFFFFFF;
diff --git a/emulators/simh/files/patch-PDP11_pdp11__cpu.c b/emulators/simh/files/patch-PDP11_pdp11__cpu.c
new file mode 100644
index 000000000000..53d2e59c7f3f
--- /dev/null
+++ b/emulators/simh/files/patch-PDP11_pdp11__cpu.c
@@ -0,0 +1,11 @@
+--- PDP11/pdp11_cpu.c.orig 2016-12-01 22:43:42 UTC
++++ PDP11/pdp11_cpu.c
+@@ -732,7 +732,7 @@ while (reason == 0) {
+
+ if (trap_req) { /* check traps, ints */
+ trapea = 0; /* assume srch fails */
+- if (t = trap_req & TRAP_ALL) { /* if a trap */
++ if ((t = trap_req & TRAP_ALL)) { /* if a trap */
+ for (trapnum = 0; trapnum < TRAP_V_MAX; trapnum++) {
+ if ((t >> trapnum) & 1) { /* trap set? */
+ trapea = trap_vec[trapnum]; /* get vec, clr */
diff --git a/emulators/simh/files/patch-PDP11_pdp11__cpumod.c b/emulators/simh/files/patch-PDP11_pdp11__cpumod.c
new file mode 100644
index 000000000000..f9c24f1f574a
--- /dev/null
+++ b/emulators/simh/files/patch-PDP11_pdp11__cpumod.c
@@ -0,0 +1,11 @@
+--- PDP11/pdp11_cpumod.c.orig 2016-12-01 22:43:42 UTC
++++ PDP11/pdp11_cpumod.c
+@@ -1075,7 +1075,7 @@ t_stat r;
+ for (i = 0; cnf_tab[i].dib != NULL; i++) { /* loop thru config tab */
+ if (((cnf_tab[i].cpum == 0) || (cpu_type & cnf_tab[i].cpum)) &&
+ ((cnf_tab[i].optm == 0) || (cpu_opt & cnf_tab[i].optm))) {
+- if (r = build_ubus_tab (&cpu_dev, cnf_tab[i].dib)) /* add to dispatch tab */
++ if ((r = build_ubus_tab (&cpu_dev, cnf_tab[i].dib))) /* add to dispatch tab */
+ return r;
+ }
+ }
diff --git a/emulators/simh/files/patch-PDP11_pdp11__dl.c b/emulators/simh/files/patch-PDP11_pdp11__dl.c
new file mode 100644
index 000000000000..ba9e50ce6f42
--- /dev/null
+++ b/emulators/simh/files/patch-PDP11_pdp11__dl.c
@@ -0,0 +1,11 @@
+--- PDP11/pdp11_dl.c.orig 2016-12-01 22:43:42 UTC
++++ PDP11/pdp11_dl.c
+@@ -346,7 +346,7 @@ if (ln >= 0) {
+ tmxr_poll_rx (&dlx_desc); /* poll for input */
+ for (ln = 0; ln < DLX_LINES; ln++) { /* loop thru lines */
+ if (dlx_ldsc[ln].conn) { /* connected? */
+- if (temp = tmxr_getc_ln (&dlx_ldsc[ln])) { /* get char */
++ if ((temp = tmxr_getc_ln (&dlx_ldsc[ln]))) { /* get char */
+ if (temp & SCPE_BREAK) /* break? */
+ c = DLIBUF_ERR|DLIBUF_RBRK;
+ else c = sim_tt_inpcvt (temp, TT_GET_MODE (dlo_unit[ln].flags));
diff --git a/emulators/simh/files/patch-PDP11_pdp11__fp.c b/emulators/simh/files/patch-PDP11_pdp11__fp.c
new file mode 100644
index 000000000000..4121b11976fa
--- /dev/null
+++ b/emulators/simh/files/patch-PDP11_pdp11__fp.c
@@ -0,0 +1,11 @@
+--- PDP11/pdp11_fp.c.orig 2016-12-01 22:43:42 UTC
++++ PDP11/pdp11_fp.c
+@@ -438,7 +438,7 @@ switch ((IR >> 8) & 017) {
+ else fac.l = ReadI (GeteaFP (dstspec, leni), dstspec, leni);
+ fac.h = 0;
+ if (fac.l) {
+- if (sign = GET_SIGN_L (fac.l))
++ if ((sign = GET_SIGN_L (fac.l)))
+ fac.l = (fac.l ^ 0xFFFFFFFF) + 1;
+ for (i = 0; GET_SIGN_L (fac.l) == 0; i++)
+ fac.l = fac.l << 1;
diff --git a/emulators/simh/files/patch-PDP11_pdp11__hk.c b/emulators/simh/files/patch-PDP11_pdp11__hk.c
new file mode 100644
index 000000000000..928a2337cf7e
--- /dev/null
+++ b/emulators/simh/files/patch-PDP11_pdp11__hk.c
@@ -0,0 +1,36 @@
+--- PDP11/pdp11_hk.c.orig 2016-12-01 22:43:42 UTC
++++ PDP11/pdp11_hk.c
+@@ -887,7 +887,7 @@ switch (fnc) {
+ err = fseek (uptr->fileref, da * sizeof (int16), SEEK_SET);
+ if (uptr->FNC == FNC_WRITE) { /* write? */
+ if (hkcs2 & CS2_UAI) { /* no addr inc? */
+- if (t = Map_ReadW (ba, 2, &comp)) { /* get 1st wd */
++ if ((t = Map_ReadW (ba, 2, &comp))) { /* get 1st wd */
+ wc = 0; /* NXM, no xfr */
+ hkcs2 = hkcs2 | CS2_NEM; /* set nxm err */
+ }
+@@ -895,7 +895,7 @@ switch (fnc) {
+ hkxb[i] = comp;
+ }
+ else { /* normal */
+- if (t = Map_ReadW (ba, wc << 1, hkxb)) { /* get buf */
++ if ((t = Map_ReadW (ba, wc << 1, hkxb))) { /* get buf */
+ wc = wc - (t >> 1); /* NXM, adj wc */
+ hkcs2 = hkcs2 | CS2_NEM; /* set nxm err */
+ }
+@@ -915,13 +915,13 @@ switch (fnc) {
+ for ( ; i < wc; i++) /* fill buf */
+ hkxb[i] = 0;
+ if (hkcs2 & CS2_UAI) { /* no addr inc? */
+- if (t = Map_WriteW (ba, 2, &hkxb[wc - 1])) {
++ if ((t = Map_WriteW (ba, 2, &hkxb[wc - 1]))) {
+ wc = 0; /* NXM, no xfr */
+ hkcs2 = hkcs2 | CS2_NEM; /* set nxm err */
+ }
+ }
+ else { /* normal */
+- if (t = Map_WriteW (ba, wc << 1, hkxb)) { /* put buf */
++ if ((t = Map_WriteW (ba, wc << 1, hkxb))) { /* put buf */
+ wc = wc - (t >> 1); /* NXM, adj wc */
+ hkcs2 = hkcs2 | CS2_NEM; /* set nxm err */
+ }
diff --git a/emulators/simh/files/patch-PDP11_pdp11__io.c b/emulators/simh/files/patch-PDP11_pdp11__io.c
new file mode 100644
index 000000000000..8752d763d679
--- /dev/null
+++ b/emulators/simh/files/patch-PDP11_pdp11__io.c
@@ -0,0 +1,23 @@
+--- PDP11/pdp11_io.c.orig 2016-12-01 22:43:42 UTC
++++ PDP11/pdp11_io.c
+@@ -373,17 +373,17 @@ init_ubus_tab ();
+ init_mbus_tab (); /* init Massbus tables */
+ for (i = 0; i < 7; i++) /* seed PIRQ intr */
+ int_vec[i + 1][pirq_bit[i]] = VEC_PIRQ;
+-if (r = cpu_build_dib ()) /* build CPU entries */
++if ((r = cpu_build_dib ())) /* build CPU entries */
+ return r;
+ for (i = 0; (dptr = sim_devices[i]) != NULL; i++) { /* loop thru dev */
+ dibp = (DIB *) dptr->ctxt; /* get DIB */
+ if (dibp && !(dptr->flags & DEV_DIS)) { /* defined, enabled? */
+ if (dptr->flags & DEV_MBUS) { /* Massbus? */
+- if (r = build_mbus_tab (dptr, dibp)) /* add to Mbus tab */
++ if ((r = build_mbus_tab (dptr, dibp))) /* add to Mbus tab */
+ return r;
+ }
+ else { /* no, Unibus */
+- if (r = build_ubus_tab (dptr, dibp)) /* add to Unibus tab */
++ if ((r = build_ubus_tab (dptr, dibp))) /* add to Unibus tab */
+ return r;
+ }
+ } /* end if enabled */
diff --git a/emulators/simh/files/patch-PDP11_pdp11__ke.c b/emulators/simh/files/patch-PDP11_pdp11__ke.c
new file mode 100644
index 000000000000..7f3201028776
--- /dev/null
+++ b/emulators/simh/files/patch-PDP11_pdp11__ke.c
@@ -0,0 +1,20 @@
+--- PDP11/pdp11_ke.c.orig 2016-12-01 22:43:42 UTC
++++ PDP11/pdp11_ke.c
+@@ -252,7 +252,7 @@ switch (PA & 017) {
+ data = data & 077; /* 6b shift count */
+ if (data != 0) {
+ t32 = (ke_AC << 16) | ke_MQ; /* 32b operand */
+- if (sign = GET_SIGN_W (ke_AC)) /* sext operand */
++ if ((sign = GET_SIGN_W (ke_AC))) /* sext operand */
+ t32 = t32 | ~017777777777;
+ if (data < 32) { /* [1,31] - left */
+ sout = (t32 >> (32 - data)) | (-sign << data);
+@@ -282,7 +282,7 @@ switch (PA & 017) {
+ data = data & 077; /* 6b shift count */
+ if (data != 0) {
+ t32 = (ke_AC << 16) | ke_MQ; /* 32b operand */
+- if (sign = GET_SIGN_W (ke_AC)) /* sext operand */
++ if ((sign = GET_SIGN_W (ke_AC))) /* sext operand */
+ t32 = t32 | ~017777777777;
+ if (data < 32) { /* [1,31] - left */
+ sout = (t32 >> (31 - data)) | (-sign << data);
diff --git a/emulators/simh/files/patch-PDP11_pdp11__rk.c b/emulators/simh/files/patch-PDP11_pdp11__rk.c
new file mode 100644
index 000000000000..1771a214912b
--- /dev/null
+++ b/emulators/simh/files/patch-PDP11_pdp11__rk.c
@@ -0,0 +1,45 @@
+--- PDP11/pdp11_rk.c.orig 2016-12-01 22:43:42 UTC
++++ PDP11/pdp11_rk.c
+@@ -545,13 +545,13 @@ if (wc && (err == 0)) {
+ rkxb[i] = 0;
+ }
+ if (rkcs & RKCS_INH) { /* incr inhibit? */
+- if (t = Map_WriteW (ma, 2, &rkxb[wc - 1])) { /* store last */
++ if ((t = Map_WriteW (ma, 2, &rkxb[wc - 1]))) { /* store last */
+ rker = rker | RKER_NXM; /* NXM? set flag */
+ wc = 0; /* no transfer */
+ }
+ }
+ else { /* normal store */
+- if (t = Map_WriteW (ma, wc << 1, rkxb)) { /* store buf */
++ if ((t = Map_WriteW (ma, wc << 1, rkxb))) { /* store buf */
+ rker = rker | RKER_NXM; /* NXM? set flag */
+ wc = wc - t; /* adj wd cnt */
+ }
+@@ -560,7 +560,7 @@ if (wc && (err == 0)) {
+
+ case RKCS_WRITE: /* write */
+ if (rkcs & RKCS_INH) { /* incr inhibit? */
+- if (t = Map_ReadW (ma, 2, &comp)) { /* get 1st word */
++ if ((t = Map_ReadW (ma, 2, &comp))) { /* get 1st word */
+ rker = rker | RKER_NXM; /* NXM? set flag */
+ wc = 0; /* no transfer */
+ }
+@@ -568,7 +568,7 @@ if (wc && (err == 0)) {
+ rkxb[i] = comp;
+ }
+ else { /* normal fetch */
+- if (t = Map_ReadW (ma, wc << 1, rkxb)) { /* get buf */
++ if ((t = Map_ReadW (ma, wc << 1, rkxb))) { /* get buf */
+ rker = rker | RKER_NXM; /* NXM? set flg */
+ wc = wc - t; /* adj wd cnt */
+ }
+@@ -584,7 +584,7 @@ if (wc && (err == 0)) {
+
+ case RKCS_WCHK: /* write check */
+ i = fxread (rkxb, sizeof (int16), wc, uptr->fileref);
+- if (err = ferror (uptr->fileref)) { /* read error? */
++ if ((err = ferror (uptr->fileref))) { /* read error? */
+ wc = 0; /* no transfer */
+ break;
+ }
diff --git a/emulators/simh/files/patch-PDP11_pdp11__rq.c b/emulators/simh/files/patch-PDP11_pdp11__rq.c
new file mode 100644
index 000000000000..28c8f514b3dc
--- /dev/null
+++ b/emulators/simh/files/patch-PDP11_pdp11__rq.c
@@ -0,0 +1,140 @@
+--- PDP11/pdp11_rq.c.orig 2016-12-01 22:43:42 UTC
++++ PDP11/pdp11_rq.c
+@@ -1352,7 +1352,7 @@ UNIT *uptr;
+ DEVICE *dptr = rq_devmap[cp->cnum];
+
+ tpkt = 0; /* set no mtch */
+-if (uptr = rq_getucb (cp, lu)) { /* get unit */
++if ((uptr = rq_getucb (cp, lu))) { /* get unit */
+ if (uptr->cpkt && /* curr pkt? */
+ (GETP32 (uptr->cpkt, CMD_REFL) == ref)) { /* match ref? */
+ tpkt = uptr->cpkt; /* save match */
+@@ -1365,8 +1365,8 @@ if (uptr = rq_getucb (cp, lu)) {
+ tpkt = uptr->pktq; /* save match */
+ uptr->pktq = cp->pak[tpkt].link; /* unlink */
+ }
+- else if (prv = uptr->pktq) { /* srch pkt q */
+- while (tpkt = cp->pak[prv].link) { /* walk list */
++ else if ((prv = uptr->pktq)) { /* srch pkt q */
++ while ((tpkt = cp->pak[prv].link)) { /* walk list */
+ if (GETP32 (tpkt, RSP_REFL) == ref) { /* match? unlink */
+ cp->pak[prv].link = cp->pak[tpkt].link;
+ break;
+@@ -1393,7 +1393,7 @@ uint32 cmd = GETP (pkt, CMD_OPC, OPC);
+ uint32 sts;
+ UNIT *uptr;
+
+-if (uptr = rq_getucb (cp, lu)) { /* unit exist? */
++if ((uptr = rq_getucb (cp, lu))) { /* unit exist? */
+ if (q && uptr->cpkt) { /* need to queue? */
+ rq_enqt (cp, &uptr->pktq, pkt); /* do later */
+ return OK;
+@@ -1447,7 +1447,7 @@ if (cp->pak[pkt].d[CMD_MOD] & MD_NXU) {
+ cp->pak[pkt].d[RSP_UN] = lu;
+ }
+ }
+-if (uptr = rq_getucb (cp, lu)) { /* unit exist? */
++if ((uptr = rq_getucb (cp, lu))) { /* unit exist? */
+ if ((uptr->flags & UNIT_ATT) == 0) /* not attached? */
+ sts = ST_OFL | SB_OFL_NV; /* offl no vol */
+ else if (uptr->flags & UNIT_ONL) /* online */
+@@ -1482,7 +1482,7 @@ uint32 cmd = GETP (pkt, CMD_OPC, OPC);
+ uint32 sts;
+ UNIT *uptr;
+
+-if (uptr = rq_getucb (cp, lu)) { /* unit exist? */
++if ((uptr = rq_getucb (cp, lu))) { /* unit exist? */
+ if (q && uptr->cpkt) { /* need to queue? */
+ rq_enqt (cp, &uptr->pktq, pkt); /* do later */
+ return OK;
+@@ -1520,7 +1520,7 @@ else {
+ cmd = GETP (pkt, CMD_OPC, OPC); /* get opcode */
+ cp->cflgs = (cp->cflgs & CF_RPL) | /* hack ctrl flgs */
+ cp->pak[pkt].d[SCC_CFL];
+- if (cp->htmo = cp->pak[pkt].d[SCC_TMO]) /* set timeout */
++ if ((cp->htmo = cp->pak[pkt].d[SCC_TMO])) /* set timeout */
+ cp->htmo = cp->htmo + 2; /* if nz, round up */
+ cp->pak[pkt].d[SCC_CFL] = cp->cflgs; /* return flags */
+ cp->pak[pkt].d[SCC_TMO] = RQ_DCTMO; /* ctrl timeout */
+@@ -1547,7 +1547,7 @@ uint32 cmd = GETP (pkt, CMD_OPC, OPC);
+ uint32 sts;
+ UNIT *uptr;
+
+-if (uptr = rq_getucb (cp, lu)) { /* unit exist? */
++if ((uptr = rq_getucb (cp, lu))) { /* unit exist? */
+ if (q && uptr->cpkt) { /* need to queue? */
+ rq_enqt (cp, &uptr->pktq, pkt); /* do later */
+ return OK;
+@@ -1576,7 +1576,7 @@ uint32 cmd = GETP (pkt, CMD_OPC, OPC);
+ uint32 sts;
+ UNIT *uptr;
+
+-if (uptr = rq_getucb (cp, lu)) { /* unit exist? */
++if ((uptr = rq_getucb (cp, lu))) { /* unit exist? */
+ if (q && uptr->cpkt) { /* need to queue? */
+ rq_enqt (cp, &uptr->pktq, pkt); /* do later */
+ return OK;
+@@ -1610,7 +1610,7 @@ uint32 cmd = GETP (pkt, CMD_OPC, OPC);
+ uint32 sts;
+ UNIT *uptr;
+
+-if (uptr = rq_getucb (cp, lu)) { /* unit exist? */
++if ((uptr = rq_getucb (cp, lu))) { /* unit exist? */
+ if (q && uptr->cpkt) { /* need to queue? */
+ rq_enqt (cp, &uptr->pktq, pkt); /* do later */
+ return OK;
+@@ -1725,7 +1725,7 @@ if (cmd == OP_ERS) {
+
+ else if (cmd == OP_WR) { /* write? */
+ t = Map_ReadW (ba, tbc, rqxb); /* fetch buffer */
+- if (abc = tbc - t) { /* any xfer? */
++ if ((abc = tbc - t)) { /* any xfer? */
+ wwc = ((abc + (RQ_NUMBY - 1)) & ~(RQ_NUMBY - 1)) >> 1;
+ for (i = (abc >> 1); i < wwc; i++)
+ rqxb[i] = 0;
+@@ -1752,7 +1752,7 @@ else {
+ err = ferror (uptr->fileref);
+ }
+ if ((cmd == OP_RD) && !err) { /* read? */
+- if (t = Map_WriteW (ba, tbc, rqxb)) { /* store, nxm? */
++ if ((t = Map_WriteW (ba, tbc, rqxb))) { /* store, nxm? */
+ PUTP32 (pkt, RW_WBCL, bc - (tbc - t)); /* adj bc */
+ PUTP32 (pkt, RW_WBAL, ba + (tbc - t)); /* adj ba */
+ if (rq_hbe (cp, uptr)) /* post err log */
+@@ -2586,11 +2586,11 @@ if ((uptr->flags & UNIT_ONL) == 0) {
+ if (uptr->cpkt) {
+ fprintf (st, "Unit %d current ", u);
+ rq_show_pkt (st, cp, uptr->cpkt);
+- if (pkt = uptr->pktq) {
++ if ((pkt = uptr->pktq)) {
+ do {
+ fprintf (st, "Unit %d queued ", u);
+ rq_show_pkt (st, cp, pkt);
+- } while (pkt = cp->pak[pkt].link);
++ } while ((pkt = cp->pak[pkt].link));
+ }
+ }
+ else fprintf (st, "Unit %d queues are empty\n", u);
+@@ -2617,7 +2617,7 @@ if (val & RQ_SH_RI) {
+ rq_show_ring (st, &cp->rq);
+ }
+ if (val & RQ_SH_FR) {
+- if (pkt = cp->freq) {
++ if ((pkt = cp->freq)) {
+ for (i = 0; pkt != 0; i++, pkt = cp->pak[pkt].link) {
+ if (i == 0)
+ fprintf (st, "Free queue = %d", pkt);
+@@ -2630,11 +2630,11 @@ if (val & RQ_SH_FR) {
+ else fprintf (st, "Free queue is empty\n");
+ }
+ if (val & RQ_SH_RS) {
+- if (pkt = cp->rspq) {
++ if ((pkt = cp->rspq)) {
+ do {
+ fprintf (st, "Response ");
+ rq_show_pkt (st, cp, pkt);
+- } while (pkt = cp->pak[pkt].link);
++ } while ((pkt = cp->pak[pkt].link));
+ }
+ else fprintf (st, "Response queue is empty\n");
+ }
diff --git a/emulators/simh/files/patch-PDP11_pdp11__sys.c b/emulators/simh/files/patch-PDP11_pdp11__sys.c
new file mode 100644
index 000000000000..59b718a114e7
--- /dev/null
+++ b/emulators/simh/files/patch-PDP11_pdp11__sys.c
@@ -0,0 +1,12 @@
+--- PDP11/pdp11_sys.c.orig 2016-12-01 22:43:42 UTC
++++ PDP11/pdp11_sys.c
+@@ -1071,7 +1071,8 @@ switch (j) {
+ for (cptr = get_glyph (cptr, gbuf, 0); gbuf[0] != 0;
+ cptr = get_glyph (cptr, gbuf, 0)) {
+ for (i = 0; (opcode[i] != NULL) &&
+- (strcmp (opcode[i], gbuf) != 0) ; i++) ;
++ (strcmp (opcode[i], gbuf) != 0) ; i++)
++ ;
+ if ((((opc_val[i] >> I_V_CL) & I_M_CL) != j) ||
+ (opcode[i] == NULL))
+ return SCPE_ARG;
diff --git a/emulators/simh/files/patch-PDP11_pdp11__ta.c b/emulators/simh/files/patch-PDP11_pdp11__ta.c
new file mode 100644
index 000000000000..5d3caa228548
--- /dev/null
+++ b/emulators/simh/files/patch-PDP11_pdp11__ta.c
@@ -0,0 +1,36 @@
+--- PDP11/pdp11_ta.c.orig 2016-12-01 22:43:42 UTC
++++ PDP11/pdp11_ta.c
+@@ -397,13 +397,13 @@ switch (uptr->FNC) {
+
+ case TACS_WRITE|TACS_3RD: /* write CRC */
+ if (ta_bptr) { /* anything to write? */
+- if (st = sim_tape_wrrecf (uptr, ta_xb, ta_bptr)) /* write, err? */
++ if ((st = sim_tape_wrrecf (uptr, ta_xb, ta_bptr))) /* write, err? */
+ r = ta_map_err (uptr, st); /* map error */
+ }
+ break; /* op done */
+
+ case TACS_WFG: /* write file gap */
+- if (st = sim_tape_wrtmk (uptr)) /* write tmk, err? */
++ if ((st = sim_tape_wrtmk (uptr))) /* write tmk, err? */
+ r = ta_map_err (uptr, st); /* map error */
+ break;
+
+@@ -413,7 +413,7 @@ switch (uptr->FNC) {
+ break;
+
+ case TACS_SRB: /* space rev blk */
+- if (st = sim_tape_sprecr (uptr, &tbc)) /* space rev, err? */
++ if ((st = sim_tape_sprecr (uptr, &tbc))) /* space rev, err? */
+ r = ta_map_err (uptr, st); /* map error */
+ break;
+
+@@ -425,7 +425,7 @@ switch (uptr->FNC) {
+ break;
+
+ case TACS_SFB: /* space fwd blk */
+- if (st = sim_tape_sprecf (uptr, &tbc)) /* space rev, err? */
++ if ((st = sim_tape_sprecf (uptr, &tbc))) /* space rev, err? */
+ r = ta_map_err (uptr, st); /* map error */
+ ta_cs |= TACS_CRC; /* CRC sets, no err */
+ break;
diff --git a/emulators/simh/files/patch-PDP11_pdp11__tm.c b/emulators/simh/files/patch-PDP11_pdp11__tm.c
new file mode 100644
index 000000000000..1139f6c04b1a
--- /dev/null
+++ b/emulators/simh/files/patch-PDP11_pdp11__tm.c
@@ -0,0 +1,53 @@
+--- PDP11/pdp11_tm.c.orig 2016-12-01 22:43:42 UTC
++++ PDP11/pdp11_tm.c
+@@ -439,7 +439,7 @@ switch (f) {
+ tm_sta = tm_sta | STA_RLE;
+ if (tbc < cbc) /* use smaller */
+ cbc = tbc;
+- if (t = Map_WriteB (xma, cbc, tmxb)) { /* copy buf to mem */
++ if ((t = Map_WriteB (xma, cbc, tmxb))) { /* copy buf to mem */
+ tm_sta = tm_sta | STA_NXM; /* NXM, set err */
+ cbc = cbc - t; /* adj byte cnt */
+ }
+@@ -449,13 +449,13 @@ switch (f) {
+
+ case MTC_WRITE: /* write */
+ case MTC_WREXT: /* write ext gap */
+- if (t = Map_ReadB (xma, cbc, tmxb)) { /* copy mem to buf */
++ if ((t = Map_ReadB (xma, cbc, tmxb))) { /* copy mem to buf */
+ tm_sta = tm_sta | STA_NXM; /* NXM, set err */
+ cbc = cbc - t; /* adj byte cnt */
+ if (cbc == 0) /* no xfr? done */
+ break;
+ }
+- if (st = sim_tape_wrrecf (uptr, tmxb, cbc)) /* write rec, err? */
++ if ((st = sim_tape_wrrecf (uptr, tmxb, cbc))) /* write rec, err? */
+ r = tm_map_err (uptr, st); /* map error */
+ else {
+ xma = (xma + cbc) & 0777777; /* inc bus addr */
+@@ -464,14 +464,14 @@ switch (f) {
+ break;
+
+ case MTC_WREOF: /* write eof */
+- if (st = sim_tape_wrtmk (uptr)) /* write tmk, err? */
++ if ((st = sim_tape_wrtmk (uptr))) /* write tmk, err? */
+ r = tm_map_err (uptr, st); /* map error */
+ break;
+
+ case MTC_SPACEF: /* space forward */
+ do {
+ tm_bc = (tm_bc + 1) & 0177777; /* incr wc */
+- if (st = sim_tape_sprecf (uptr, &tbc)) { /* spc rec fwd, err? */
++ if ((st = sim_tape_sprecf (uptr, &tbc))) { /* spc rec fwd, err? */
+ r = tm_map_err (uptr, st); /* map error */
+ break;
+ }
+@@ -481,7 +481,7 @@ switch (f) {
+ case MTC_SPACER: /* space reverse */
+ do {
+ tm_bc = (tm_bc + 1) & 0177777; /* incr wc */
+- if (st = sim_tape_sprecr (uptr, &tbc)) { /* spc rec rev, err? */
++ if ((st = sim_tape_sprecr (uptr, &tbc))) { /* spc rec rev, err? */
+ r = tm_map_err (uptr, st); /* map error */
+ break;
+ }
diff --git a/emulators/simh/files/patch-PDP11_pdp11__tq.c b/emulators/simh/files/patch-PDP11_pdp11__tq.c
new file mode 100644
index 000000000000..3e45e6829fe1
--- /dev/null
+++ b/emulators/simh/files/patch-PDP11_pdp11__tq.c
@@ -0,0 +1,176 @@
+--- PDP11/pdp11_tq.c.orig 2016-12-01 22:43:42 UTC
++++ PDP11/pdp11_tq.c
+@@ -780,7 +780,7 @@ else if (mdf & ~tq_cmf[cmd]) {
+ sts = ST_CMD | I_MODF; /* ill mods */
+ }
+ else { /* valid cmd */
+- if (uptr = tq_getucb (lu)) { /* valid unit? */
++ if ((uptr = tq_getucb (lu))) { /* valid unit? */
+ if (q && (tq_cmf[cmd] & CMF_SEQ) && /* queueing, seq, */
+ (uptr->cpkt || uptr->pktq)) { /* and active? */
+ tq_enqt (&uptr->pktq, pkt); /* do later */
+@@ -858,7 +858,7 @@ int32 tpkt, prv;
+ UNIT *uptr;
+
+ tpkt = 0; /* set no mtch */
+-if (uptr = tq_getucb (lu)) { /* get unit */
++if ((uptr = tq_getucb (lu))) { /* get unit */
+ if (uptr->cpkt && /* curr pkt? */
+ (GETP32 (uptr->cpkt, CMD_REFL) == ref)) { /* match ref? */
+ tpkt = uptr->cpkt; /* save match */
+@@ -871,8 +871,8 @@ if (uptr = tq_getucb (lu)) {
+ tpkt = uptr->pktq; /* save match */
+ uptr->pktq = tq_pkt[tpkt].link; /* unlink */
+ }
+- else if (prv = uptr->pktq) { /* srch pkt q */
+- while (tpkt = tq_pkt[prv].link) { /* walk list */
++ else if ((prv = uptr->pktq)) { /* srch pkt q */
++ while ((tpkt = tq_pkt[prv].link)) { /* walk list */
+ if (GETP32 (tpkt, RSP_REFL) == ref) { /* match ref? */
+ tq_pkt[prv].link = tq_pkt[tpkt].link; /* unlink */
+ break;
+@@ -900,7 +900,7 @@ uint32 mdf = tq_pkt[pkt].d[CMD_MOD];
+ uint32 sts;
+ UNIT *uptr;
+
+-if (uptr = tq_getucb (lu)) { /* unit exist? */
++if ((uptr = tq_getucb (lu))) { /* unit exist? */
+ if (uptr->flags & UNIT_SXC) /* ser exc pending? */
+ sts = ST_SXC;
+ else {
+@@ -955,7 +955,7 @@ if (tq_pkt[pkt].d[CMD_MOD] & MD_NXU) {
+ tq_pkt[pkt].d[RSP_UN] = lu;
+ }
+ }
+-if (uptr = tq_getucb (lu)) { /* unit exist? */
++if ((uptr = tq_getucb (lu))) { /* unit exist? */
+ if ((uptr->flags & UNIT_ATT) == 0) /* not attached? */
+ sts = ST_OFL | SB_OFL_NV; /* offl no vol */
+ else if (uptr->flags & UNIT_ONL) /* online */
+@@ -980,7 +980,7 @@ uint32 lu = tq_pkt[pkt].d[CMD_UN];
+ uint32 sts;
+ UNIT *uptr;
+
+-if (uptr = tq_getucb (lu)) { /* unit exist? */
++if ((uptr = tq_getucb (lu))) { /* unit exist? */
+ if ((uptr->flags & UNIT_ATT) == 0) /* not attached? */
+ sts = ST_OFL | SB_OFL_NV; /* offl no vol */
+ else if (uptr->flags & UNIT_ONL) /* already online? */
+@@ -1009,7 +1009,7 @@ if (tq_pkt[pkt].d[SCC_MSV])
+ else {
+ tq_cflgs = (tq_cflgs & CF_RPL) | /* hack ctrl flgs */
+ tq_pkt[pkt].d[SCC_CFL];
+- if (tq_htmo = tq_pkt[pkt].d[SCC_TMO]) /* set timeout */
++ if ((tq_htmo = tq_pkt[pkt].d[SCC_TMO])) /* set timeout */
+ tq_htmo = tq_htmo + 2; /* if nz, round up */
+ tq_pkt[pkt].d[SCC_CFL] = tq_cflgs; /* return flags */
+ tq_pkt[pkt].d[SCC_TMO] = TQ_DCTMO; /* ctrl timeout */
+@@ -1033,7 +1033,7 @@ uint32 lu = tq_pkt[pkt].d[CMD_UN];
+ uint32 sts;
+ UNIT *uptr;
+
+-if (uptr = tq_getucb (lu)) { /* unit exist? */
++if ((uptr = tq_getucb (lu))) { /* unit exist? */
+ if ((uptr->flags & UNIT_ATT) == 0) /* not attached? */
+ sts = ST_OFL | SB_OFL_NV; /* offl no vol */
+ else {
+@@ -1055,7 +1055,7 @@ uint32 lu = tq_pkt[pkt].d[CMD_UN];
+ uint32 sts;
+ UNIT *uptr;
+
+-if (uptr = tq_getucb (lu)) /* unit exist? */
++if ((uptr = tq_getucb (lu))) /* unit exist? */
+ sts = tq_mot_valid (uptr, OP_FLU); /* validate req */
+ else sts = ST_OFL; /* offline */
+ tq_putr (pkt, OP_FLU | OP_END, tq_efl (uptr), sts, FLU_LNT, UQ_TYP_SEQ);
+@@ -1071,7 +1071,7 @@ uint32 cmd = GETP (pkt, CMD_OPC, OPC);
+ uint32 sts;
+ UNIT *uptr;
+
+-if (uptr = tq_getucb (lu)) { /* unit exist? */
++if ((uptr = tq_getucb (lu))) { /* unit exist? */
+ sts = tq_mot_valid (uptr, cmd); /* validity checks */
+ if (sts == ST_SUC) { /* ok? */
+ uptr->cpkt = pkt; /* op in progress */
+@@ -1092,7 +1092,7 @@ uint32 lu = tq_pkt[pkt].d[CMD_UN];
+ uint32 sts, objp = 0;
+ UNIT *uptr;
+
+-if (uptr = tq_getucb (lu)) { /* unit exist? */
++if ((uptr = tq_getucb (lu))) { /* unit exist? */
+ objp = uptr->objp; /* position op */
+ sts = tq_mot_valid (uptr, OP_WTM); /* validity checks */
+ if (sts == ST_SUC) { /* ok? */
+@@ -1115,7 +1115,7 @@ uint32 lu = tq_pkt[pkt].d[CMD_UN];
+ uint32 sts, objp = 0;
+ UNIT *uptr;
+
+-if (uptr = tq_getucb (lu)) { /* unit exist? */
++if ((uptr = tq_getucb (lu))) { /* unit exist? */
+ objp = uptr->objp; /* position op */
+ sts = tq_mot_valid (uptr, OP_POS); /* validity checks */
+ if (sts == ST_SUC) { /* ok? */
+@@ -1147,7 +1147,7 @@ uint32 bc = GETP32 (pkt, RW_BCL);
+ uint32 sts, objp = 0;
+ UNIT *uptr;
+
+-if (uptr = tq_getucb (lu)) { /* unit exist? */
++if ((uptr = tq_getucb (lu))) { /* unit exist? */
+ objp = uptr->objp; /* position op */
+ sts = tq_mot_valid (uptr, cmd); /* validity checks */
+ if (sts == ST_SUC) { /* ok? */
+@@ -1251,7 +1251,7 @@ switch (cmd) {
+ }
+ else wbc = tbc;
+ if (cmd == OP_RD) { /* read? */
+- if (t = Map_WriteB (ba, wbc, tqxb)) { /* store, nxm? */
++ if ((t = Map_WriteB (ba, wbc, tqxb))) { /* store, nxm? */
+ PUTP32 (pkt, RW_BCL, wbc - t); /* adj bc */
+ if (tq_hbe (uptr, ba + wbc - t)) /* post err log */
+ tq_mot_end (uptr, EF_LOG, ST_HST | SB_HST_NXM, tbc);
+@@ -1288,7 +1288,7 @@ switch (cmd) {
+ break;
+
+ case OP_WR: /* write */
+- if (t = Map_ReadB (ba, bc, tqxb)) { /* fetch buf, nxm? */
++ if ((t = Map_ReadB (ba, bc, tqxb))) { /* fetch buf, nxm? */
+ PUTP32 (pkt, RW_BCL, 0); /* no bytes xfer'd */
+ if (tq_hbe (uptr, ba + bc - t)) /* post err log */
+ tq_mot_end (uptr, EF_LOG, ST_HST | SB_HST_NXM, bc);
+@@ -2233,11 +2233,11 @@ if ((uptr->flags & UNIT_ONL) == 0) {
+ if (uptr->cpkt) {
+ fprintf (st, "Unit %d current ", u);
+ tq_show_pkt (st, uptr->cpkt);
+- if (pkt = uptr->pktq) {
++ if ((pkt = uptr->pktq)) {
+ do {
+ fprintf (st, "Unit %d queued ", u);
+ tq_show_pkt (st, pkt);
+- } while (pkt = tq_pkt[pkt].link);
++ } while ((pkt = tq_pkt[pkt].link));
+ }
+ }
+ else fprintf (st, "Unit %d queues are empty\n", u);
+@@ -2262,7 +2262,7 @@ if (val & TQ_SH_RI) {
+ tq_show_ring (st, &tq_rq);
+ }
+ if (val & TQ_SH_FR) {
+- if (pkt = tq_freq) {
++ if ((pkt = tq_freq)) {
+ for (i = 0; pkt != 0; i++, pkt = tq_pkt[pkt].link) {
+ if (i == 0)
+ fprintf (st, "Free queue = %d", pkt);
+@@ -2275,11 +2275,11 @@ if (val & TQ_SH_FR) {
+ else fprintf (st, "Free queue is empty\n");
+ }
+ if (val & TQ_SH_RS) {
+- if (pkt = tq_rspq) {
++ if ((pkt = tq_rspq)) {
+ do {
+ fprintf (st, "Response ");
+ tq_show_pkt (st, pkt);
+- } while (pkt = tq_pkt[pkt].link);
++ } while ((pkt = tq_pkt[pkt].link));
+ }
+ else fprintf (st, "Response queue is empty\n");
+ }
diff --git a/emulators/simh/files/patch-PDP11_pdp11__ts.c b/emulators/simh/files/patch-PDP11_pdp11__ts.c
new file mode 100644
index 000000000000..15535a910afa
--- /dev/null
+++ b/emulators/simh/files/patch-PDP11_pdp11__ts.c
@@ -0,0 +1,38 @@
+--- PDP11/pdp11_ts.c.orig 2016-12-01 22:43:42 UTC
++++ PDP11/pdp11_ts.c
+@@ -490,7 +490,7 @@ do {
+ fc = (fc - 1) & DMASK; /* decr wc */
+ if (upd)
+ msgrfc = fc;
+- if (st = sim_tape_sprecf (uptr, &tbc)) /* space rec fwd, err? */
++ if ((st = sim_tape_sprecf (uptr, &tbc))) /* space rec fwd, err? */
+ return ts_map_status (st); /* map status */
+ msgxs0 = msgxs0 | XS0_MOT; /* tape has moved */
+ } while (fc != 0);
+@@ -533,7 +533,7 @@ do {
+ fc = (fc - 1) & DMASK; /* decr wc */
+ if (upd)
+ msgrfc = fc;
+- if (st = sim_tape_sprecr (uptr, &tbc)) /* space rec rev, err? */
++ if ((st = sim_tape_sprecr (uptr, &tbc))) /* space rec rev, err? */
+ return ts_map_status (st); /* map status */
+ msgxs0 = msgxs0 | XS0_MOT; /* tape has moved */
+ } while (fc != 0);
+@@ -666,7 +666,7 @@ else {
+ return TC5;
+ }
+ }
+-if (st = sim_tape_wrrecf (uptr, tsxb, fc)) /* write rec, err? */
++if ((st = sim_tape_wrrecf (uptr, tsxb, fc))) /* write rec, err? */
+ return ts_map_status (st); /* return status */
+ msgxs0 = msgxs0 | XS0_MOT; /* tape has moved */
+ msgrfc = 0;
+@@ -679,7 +679,7 @@ int32 ts_wtmk (UNIT *uptr)
+ {
+ t_stat st;
+
+-if (st = sim_tape_wrtmk (uptr)) /* write tmk, err? */
++if ((st = sim_tape_wrtmk (uptr))) /* write tmk, err? */
+ return ts_map_status (st); /* return status */
+ msgxs0 = msgxs0 | XS0_MOT; /* tape has moved */
+ if (sim_tape_eot (&ts_unit)) /* EOT on write? */
diff --git a/emulators/simh/files/patch-PDP11_pdp11__tu.c b/emulators/simh/files/patch-PDP11_pdp11__tu.c
new file mode 100644
index 000000000000..c04783dd71d7
--- /dev/null
+++ b/emulators/simh/files/patch-PDP11_pdp11__tu.c
@@ -0,0 +1,56 @@
+--- PDP11/pdp11_tu.c.orig 2016-12-01 22:43:42 UTC
++++ PDP11/pdp11_tu.c
+@@ -647,7 +647,7 @@ switch (fnc) {
+ case FNC_SPACEF: /* space forward */
+ do {
+ tufc = (tufc + 1) & 0177777; /* incr fc */
+- if (st = sim_tape_sprecf (uptr, &tbc)) { /* space rec fwd, err? */
++ if ((st = sim_tape_sprecf (uptr, &tbc))) { /* space rec fwd, err? */
+ r = tu_map_err (drv, st, 0); /* map error */
+ break;
+ }
+@@ -660,7 +660,7 @@ switch (fnc) {
+ case FNC_SPACER: /* space reverse */
+ do {
+ tufc = (tufc + 1) & 0177777; /* incr wc */
+- if (st = sim_tape_sprecr (uptr, &tbc)) { /* space rec rev, err? */
++ if ((st = sim_tape_sprecr (uptr, &tbc))) { /* space rec rev, err? */
+ r = tu_map_err (drv, st, 0); /* map error */
+ break;
+ }
+@@ -671,7 +671,7 @@ switch (fnc) {
+ break;
+
+ case FNC_WREOF: /* write end of file */
+- if (st = sim_tape_wrtmk (uptr)) /* write tmk, err? */
++ if ((st = sim_tape_wrtmk (uptr))) /* write tmk, err? */
+ r = tu_map_err (drv, st, 0); /* map error */
+ break;
+
+@@ -687,7 +687,7 @@ switch (fnc) {
+ tufc = 0; /* clear frame count */
+ if ((uptr->UDENS == TC_1600) && sim_tape_bot (uptr))
+ tufs = tufs | FS_ID; /* PE BOT? ID burst */
+- if (st = sim_tape_rdrecf (uptr, xbuf, &tbc, MT_MAXFR)) { /* read fwd */
++ if ((st = sim_tape_rdrecf (uptr, xbuf, &tbc, MT_MAXFR))) { /* read fwd */
+ if (st == MTSE_TMK) /* tmk also sets FCE */
+ tu_set_er (ER_FCE);
+ r = tu_map_err (drv, st, 1); /* map error */
+@@ -739,7 +739,7 @@ switch (fnc) {
+ }
+ tbc = xbc;
+ }
+- if (st = sim_tape_wrrecf (uptr, xbuf, tbc)) /* write rec, err? */
++ if ((st = sim_tape_wrrecf (uptr, xbuf, tbc))) /* write rec, err? */
+ r = tu_map_err (drv, st, 1); /* map error */
+ else {
+ tufc = (tufc + tbc) & 0177777;
+@@ -751,7 +751,7 @@ switch (fnc) {
+ case FNC_READR: /* read reverse */
+ case FNC_WCHKR: /* wcheck = read */
+ tufc = 0; /* clear frame count */
+- if (st = sim_tape_rdrecr (uptr, xbuf + 4, &tbc, MT_MAXFR)) { /* read rev */
++ if ((st = sim_tape_rdrecr (uptr, xbuf + 4, &tbc, MT_MAXFR))) { /* read rev */
+ if (st == MTSE_TMK) /* tmk also sets FCE */
+ tu_set_er (ER_FCE);
+ r = tu_map_err (drv, st, 1); /* map error */
diff --git a/emulators/simh/files/patch-PDP11_pdp11__xq.c b/emulators/simh/files/patch-PDP11_pdp11__xq.c
new file mode 100644
index 000000000000..ec54cf9e99d9
--- /dev/null
+++ b/emulators/simh/files/patch-PDP11_pdp11__xq.c
@@ -0,0 +1,39 @@
+--- PDP11/pdp11_xq.c.orig 2016-12-01 22:43:42 UTC
++++ PDP11/pdp11_xq.c
+@@ -1187,7 +1187,7 @@ t_stat xq_process_setup(CTLR* xq)
+
+ xq->var->setup.multicast = (0 != (len & XQ_SETUP_MC));
+ xq->var->setup.promiscuous = (0 != (len & XQ_SETUP_PM));
+- if (led = (len & XQ_SETUP_LD) >> 2) {
++ if ((led = (len & XQ_SETUP_LD) >> 2)) {
+ switch (led) {
+ case 1: xq->var->setup.l1 = 0; break;
+ case 2: xq->var->setup.l2 = 0; break;
+@@ -2073,6 +2073,10 @@ t_stat xq_process_bootrom (CTLR* xq)
+ /* set to next bdl (implicit chain) */
+ xq->var->rbdl_ba += 12;
+ break;
++
++ case XQ_T_DELQA:
++ case XQ_T_DELQA_PLUS:
++ break;
+ } /* switch */
+
+ /* --------------------------- Done, finish up -----------------------------*/
+@@ -2531,7 +2535,7 @@ t_stat xq_tmrsvc(UNIT* uptr)
+
+ /* has sanity timer expired? if so, reboot */
+ if (xq->var->sanity.enabled)
+- if (--xq->var->sanity.timer <= 0)
++ if (--xq->var->sanity.timer <= 0) {
+ if (xq->var->mode != XQ_T_DELQA_PLUS)
+ return xq_boot_host(xq);
+ else { /* DELQA-T Host Inactivity Timer expiration means switch out of DELQA-T mode */
+@@ -2540,6 +2544,7 @@ t_stat xq_tmrsvc(UNIT* uptr)
+ xq->var->iba = xq->var->srr = 0;
+ xq->var->var = XQ_VEC_MS | XQ_VEC_OS;
+ }
++ }
+
+ /* has system id timer expired? if so, do system id */
+ if (--xq->var->idtmr <= 0) {
diff --git a/emulators/simh/files/patch-PDP18B_pdp18b__cpu.c b/emulators/simh/files/patch-PDP18B_pdp18b__cpu.c
new file mode 100644
index 000000000000..a9aaa6dca8b3
--- /dev/null
+++ b/emulators/simh/files/patch-PDP18B_pdp18b__cpu.c
@@ -0,0 +1,11 @@
+--- PDP18B/pdp18b_cpu.c.orig 2016-12-01 22:43:42 UTC
++++ PDP18B/pdp18b_cpu.c
+@@ -604,7 +604,7 @@ while (reason == 0) {
+ int32 link_init, fill;
+
+ if (sim_interval <= 0) { /* check clock queue */
+- if (reason = sim_process_event ())
++ if ((reason = sim_process_event ()))
+ break;
+ api_int = api_eval (&int_pend); /* eval API */
+ }
diff --git a/emulators/simh/files/patch-PDP18B_pdp18b__fpp.c b/emulators/simh/files/patch-PDP18B_pdp18b__fpp.c
new file mode 100644
index 000000000000..958da5e91b8e
--- /dev/null
+++ b/emulators/simh/files/patch-PDP18B_pdp18b__fpp.c
@@ -0,0 +1,111 @@
+--- PDP18B/pdp18b_fpp.c.orig 2016-12-01 22:43:42 UTC
++++ PDP18B/pdp18b_fpp.c
+@@ -253,7 +253,7 @@ switch (fop) {
+ break;
+
+ case FOP_SUB: /* subtract */
+- if (sta = fp15_opnd (fir, ar, &fmb)) /* fetch op to FMB */
++ if ((sta = fp15_opnd (fir, ar, &fmb))) /* fetch op to FMB */
+ break;
+ if (fir & FI_FP) /* fp? */
+ sta = fp15_fadd (fir, &fma, &fmb, 1); /* yes, fp sub */
+@@ -262,7 +262,7 @@ switch (fop) {
+
+ case FOP_RSUB: /* reverse sub */
+ fmb = fma; /* FMB <- FMA */
+- if (sta = fp15_opnd (fir, ar, &fma)) /* fetch op to FMA */
++ if ((sta = fp15_opnd (fir, ar, &fma))) /* fetch op to FMA */
+ break;
+ if (fir & FI_FP) /* fp? */
+ sta = fp15_fadd (fir, &fma, &fmb, 1); /* yes, fp sub */
+@@ -270,7 +270,7 @@ switch (fop) {
+ break;
+
+ case FOP_MUL: /* multiply */
+- if (sta = fp15_opnd (fir, ar, &fmb)) /* fetch op to FMB */
++ if ((sta = fp15_opnd (fir, ar, &fmb))) /* fetch op to FMB */
+ break;
+ if (fir & FI_FP) /* fp? */
+ sta = fp15_fmul (fir, &fma, &fmb); /* yes, fp mul */
+@@ -278,9 +278,9 @@ switch (fop) {
+ break;
+
+ case FOP_DIV: /* divide */
+- if (sta = fp15_opnd (fir, ar, &fmb)) /* fetch op to FMB */
++ if ((sta = fp15_opnd (fir, ar, &fmb))) /* fetch op to FMB */
+ break;
+- if (sta = fp15_opnd (fir, ar, &fmb)) break; /* fetch op to FMB */
++ if ((sta = fp15_opnd (fir, ar, &fmb))) break; /* fetch op to FMB */
+ if (fir & FI_FP) /* fp? */
+ sta = fp15_fdiv (fir, &fma, &fmb); /* yes, fp div */
+ else sta = fp15_idiv (fir, &fma, &fmb); /* no, int div */
+@@ -288,7 +288,7 @@ switch (fop) {
+
+ case FOP_RDIV: /* reverse divide */
+ fmb = fma; /* FMB <- FMA */
+- if (sta = fp15_opnd (fir, ar, &fma)) /* fetch op to FMA */
++ if ((sta = fp15_opnd (fir, ar, &fma))) /* fetch op to FMA */
+ break;
+ if (fir & FI_FP) /* fp? */
+ sta = fp15_fdiv (fir, &fma, &fmb); /* yes, fp div */
+@@ -296,7 +296,7 @@ switch (fop) {
+ break;
+
+ case FOP_LD: /* load */
+- if (sta = fp15_opnd (fir, ar, &fma)) /* fetch op to FMA */
++ if ((sta = fp15_opnd (fir, ar, &fma))) /* fetch op to FMA */
+ break;
+ fp15_asign (fir, &fma); /* modify A sign */
+ if (fir & FI_FP) /* fp? */
+@@ -309,7 +309,7 @@ switch (fop) {
+ break;
+
+ case FOP_FLT: /* float */
+- if (sta = fp15_opnd (fir, ar, &fma)) /* fetch op to FMA */
++ if ((sta = fp15_opnd (fir, ar, &fma))) /* fetch op to FMA */
+ break;
+ fma.exp = 35;
+ fp15_asign (fir, &fma); /* adjust A sign */
+@@ -317,13 +317,13 @@ switch (fop) {
+ break;
+
+ case FOP_FIX: /* fix */
+- if (sta = fp15_opnd (fir, ar, &fma)) /* fetch op to FMA */
++ if ((sta = fp15_opnd (fir, ar, &fma))) /* fetch op to FMA */
+ break;
+ sta = fp15_fix (fir, &fma); /* fix */
+ break;
+
+ case FOP_LFMQ: /* load FMQ */
+- if (sta = fp15_opnd (fir, ar, &fma)) /* fetch op to FMA */
++ if ((sta = fp15_opnd (fir, ar, &fma))) /* fetch op to FMA */
+ break;
+ dp_swap (&fma, &fmq); /* swap FMA, FMQ */
+ fp15_asign (fir, &fma); /* adjust A sign */
+@@ -337,7 +337,7 @@ switch (fop) {
+ sta = Write (ar, dat, WR);
+ }
+ else { /* no, load */
+- if (sta = Read (ar, &dat, RD))
++ if ((sta = Read (ar, &dat, RD)))
+ break;
+ fguard = (dat >> JEA_V_GUARD) & 1;
+ jea = dat & JEA_EAMASK;
+@@ -345,7 +345,7 @@ switch (fop) {
+ break;
+
+ case FOP_ADD: /* add */
+- if (sta = fp15_opnd (fir, ar, &fmb)) /* fetch op to FMB */
++ if ((sta = fp15_opnd (fir, ar, &fmb))) /* fetch op to FMB */
+ break;
+ if (fir & FI_FP) /* fp? */
+ sta = fp15_fadd (fir, &fma, &fmb, 0); /* yes, fp add */
+@@ -429,7 +429,7 @@ t_stat sta;
+
+ fguard = 0; /* clear guard */
+ if (ir & FI_FP) { /* fp? */
+- if (sta = fp15_norm (ir, a, NULL, 0)) /* normalize */
++ if ((sta = fp15_norm (ir, a, NULL, 0))) /* normalize */
+ return sta;
+ if (ir & FI_DP) { /* dp? */
+ wd[0] = a->exp & DMASK; /* exponent */
diff --git a/emulators/simh/files/patch-PDP18B_pdp18b__mt.c b/emulators/simh/files/patch-PDP18B_pdp18b__mt.c
new file mode 100644
index 000000000000..d8163597fcc5
--- /dev/null
+++ b/emulators/simh/files/patch-PDP18B_pdp18b__mt.c
@@ -0,0 +1,38 @@
+--- PDP18B/pdp18b_mt.c.orig 2016-12-01 22:43:42 UTC
++++ PDP18B/pdp18b_mt.c
+@@ -353,7 +353,7 @@ switch (f) {
+ mtxb[p++] = M[xma] & 0377;
+ }
+ } /* end for */
+- if (st = sim_tape_wrrecf (uptr, mtxb, tbc)) /* write rec, err? */
++ if ((st = sim_tape_wrrecf (uptr, mtxb, tbc))) /* write rec, err? */
+ r = mt_map_err (uptr, st); /* map error */
+ else {
+ M[MT_CA] = (M[MT_CA] + wc) & DMASK; /* advance mem addr */
+@@ -363,7 +363,7 @@ switch (f) {
+ break;
+
+ case FN_WREOF:
+- if (st = sim_tape_wrtmk (uptr)) /* write tmk, err? */
++ if ((st = sim_tape_wrtmk (uptr))) /* write tmk, err? */
+ r = mt_map_err (uptr, st); /* map error */
+ else uptr->USTAT = STA_EOF;
+ mt_cu = mt_cu & ~CU_ERASE; /* clear erase flag */
+@@ -372,7 +372,7 @@ switch (f) {
+ case FN_SPACEF: /* space forward */
+ do {
+ M[MT_WC] = (M[MT_WC] + 1) & DMASK; /* inc WC */
+- if (st = sim_tape_sprecf (uptr, &tbc)) { /* space rec fwd, err? */
++ if ((st = sim_tape_sprecf (uptr, &tbc))) { /* space rec fwd, err? */
+ r = mt_map_err (uptr, st); /* map error */
+ break;
+ }
+@@ -382,7 +382,7 @@ switch (f) {
+ case FN_SPACER: /* space reverse */
+ do {
+ M[MT_WC] = (M[MT_WC] + 1) & DMASK; /* inc WC */
+- if (st = sim_tape_sprecr (uptr, &tbc)) { /* space rec rev, err? */
++ if ((st = sim_tape_sprecr (uptr, &tbc))) { /* space rec rev, err? */
+ r = mt_map_err (uptr, st); /* map error */
+ break;
+ }
diff --git a/emulators/simh/files/patch-PDP18B_pdp18b__stddev.c b/emulators/simh/files/patch-PDP18B_pdp18b__stddev.c
new file mode 100644
index 000000000000..7cde2d773499
--- /dev/null
+++ b/emulators/simh/files/patch-PDP18B_pdp18b__stddev.c
@@ -0,0 +1,11 @@
+--- PDP18B/pdp18b_stddev.c.orig 2016-12-01 22:43:42 UTC
++++ PDP18B/pdp18b_stddev.c
+@@ -594,7 +594,7 @@ if ((temp = getc (ptr_unit.fileref)) ==
+ if (ptr_state == 0) { /* ASCII */
+ if (ptr_unit.flags & UNIT_RASCII) { /* want parity? */
+ ptr_unit.buf = temp = temp & 0177; /* parity off */
+- while (temp = temp & (temp - 1))
++ while ((temp = temp & (temp - 1)))
+ ptr_unit.buf = ptr_unit.buf ^ 0200; /* count bits */
+ ptr_unit.buf = ptr_unit.buf ^ 0200; /* set even parity */
+ }
diff --git a/emulators/simh/files/patch-PDP18B_pdp18b__sys.c b/emulators/simh/files/patch-PDP18B_pdp18b__sys.c
new file mode 100644
index 000000000000..e3f18bd4413d
--- /dev/null
+++ b/emulators/simh/files/patch-PDP18B_pdp18b__sys.c
@@ -0,0 +1,11 @@
+--- PDP18B/pdp18b_sys.c.orig 2016-12-01 22:43:42 UTC
++++ PDP18B/pdp18b_sys.c
+@@ -1009,7 +1009,7 @@ for (i = 0; opc_val[i] >= 0; i++) {
+ break;
+
+ case I_V_OPR: /* operate */
+- if (sp = (inst & 03730))
++ if ((sp = (inst & 03730)))
+ fprintf (of, "%s", opcode[i]);
+ fprint_opr (of, inst & 014047, I_V_OPR, sp);
+ break;
diff --git a/emulators/simh/files/patch-PDP18B_pdp18b__tt1.c b/emulators/simh/files/patch-PDP18B_pdp18b__tt1.c
new file mode 100644
index 000000000000..b9707fe39db3
--- /dev/null
+++ b/emulators/simh/files/patch-PDP18B_pdp18b__tt1.c
@@ -0,0 +1,11 @@
+--- PDP18B/pdp18b_tt1.c.orig 2016-12-01 22:43:42 UTC
++++ PDP18B/pdp18b_tt1.c
+@@ -222,7 +222,7 @@ if (ln >= 0)
+ tmxr_poll_rx (&ttx_desc); /* poll for input */
+ for (ln = 0; ln < TTX_MAXL; ln++) { /* loop thru lines */
+ if (ttx_ldsc[ln].conn) { /* connected? */
+- if (temp = tmxr_getc_ln (&ttx_ldsc[ln])) { /* get char */
++ if ((temp = tmxr_getc_ln (&ttx_ldsc[ln]))) { /* get char */
+ if (temp & SCPE_BREAK) /* break? */
+ c = 0;
+ else c = sim_tt_inpcvt (temp, TT_GET_MODE (ttox_unit[ln].flags) | TTUF_KSR);
diff --git a/emulators/simh/files/patch-PDP1_pdp1__cpu.c b/emulators/simh/files/patch-PDP1_pdp1__cpu.c
new file mode 100644
index 000000000000..14407a1639f4
--- /dev/null
+++ b/emulators/simh/files/patch-PDP1_pdp1__cpu.c
@@ -0,0 +1,302 @@
+--- PDP1/pdp1_cpu.c.orig 2016-12-01 22:43:42 UTC
++++ PDP1/pdp1_cpu.c
+@@ -546,7 +546,7 @@ reason = 0;
+ while (reason == 0) { /* loop until halted */
+
+ if (sim_interval <= 0) { /* check clock queue */
+- if (reason = sim_process_event ())
++ if ((reason = sim_process_event ()))
+ break;
+ sbs_lvl = sbs_eval (); /* eval sbs system */
+ }
+@@ -610,25 +610,25 @@ while (reason == 0) {
+ /* Logical, load, store instructions */
+
+ case 001: /* AND */
+- if (reason = Ea (IR)) /* MA <- eff addr */
++ if ((reason = Ea (IR))) /* MA <- eff addr */
+ break;
+- if (reason = Read ()) /* MB <- data */
++ if ((reason = Read ())) /* MB <- data */
+ break;
+ AC = AC & MB;
+ break;
+
+ case 002: /* IOR */
+- if (reason = Ea (IR)) /* MA <- eff addr */
++ if ((reason = Ea (IR))) /* MA <- eff addr */
+ break;
+- if (reason = Read ()) /* MB <- data */
++ if ((reason = Read ())) /* MB <- data */
+ break;
+ AC = AC | MB;
+ break;
+
+ case 003: /* XOR */
+- if (reason = Ea (IR)) /* MA <- eff addr */
++ if ((reason = Ea (IR))) /* MA <- eff addr */
+ break;
+- if (reason = Read ()) /* MB <- data */
++ if ((reason = Read ())) /* MB <- data */
+ break;
+ AC = AC ^ MB;
+ break;
+@@ -638,9 +638,9 @@ while (reason == 0) {
+ reason = STOP_XCT;
+ break;
+ }
+- if (reason = Ea (IR)) /* MA <- eff addr */
++ if ((reason = Ea (IR))) /* MA <- eff addr */
+ break;
+- if (reason = Read ()) /* MB <- data */
++ if ((reason = Read ())) /* MB <- data */
+ break;
+ xct_count = xct_count + 1; /* count XCT's */
+ IR = MB; /* get instruction */
+@@ -648,9 +648,9 @@ while (reason == 0) {
+
+ case 005: /* LCH */
+ if (cpu_unit.flags & UNIT_1D) { /* PDP-1D? */
+- if (reason = Ea_ch (IR, &byno)) /* MA <- eff addr */
++ if ((reason = Ea_ch (IR, &byno))) /* MA <- eff addr */
+ break;
+- if (reason = Read ()) /* MB <- data */
++ if ((reason = Read ())) /* MB <- data */
+ break;
+ AC = (MB << byt_shf[byno]) & 0770000; /* extract byte */
+ }
+@@ -659,9 +659,9 @@ while (reason == 0) {
+
+ case 006: /* DCH */
+ if (cpu_unit.flags & UNIT_1D) { /* PDP-1D? */
+- if (reason = Ea_ch (IR, &byno)) /* MA <- eff addr */
++ if ((reason = Ea_ch (IR, &byno))) /* MA <- eff addr */
+ break;
+- if (reason = Read ()) /* MB <- data */
++ if ((reason = Read ())) /* MB <- data */
+ break;
+ MB = (MB & ~(0770000 >> byt_shf[byno])) | /* insert byte */
+ ((AC & 0770000) >> byt_shf[byno]);
+@@ -683,55 +683,55 @@ while (reason == 0) {
+ break;
+
+ case 010: /* LAC */
+- if (reason = Ea (IR)) /* MA <- eff addr */
++ if ((reason = Ea (IR))) /* MA <- eff addr */
+ break;
+- if (reason = Read ()) /* MB <- data */
++ if ((reason = Read ())) /* MB <- data */
+ break;
+ AC = MB;
+ break;
+
+ case 011: /* LIO */
+- if (reason = Ea (IR)) /* MA <- eff addr */
++ if ((reason = Ea (IR))) /* MA <- eff addr */
+ break;
+- if (reason = Read ()) /* MB <- data */
++ if ((reason = Read ())) /* MB <- data */
+ break;
+ IO = MB;
+ break;
+
+ case 012: /* DAC */
+- if (reason = Ea (IR)) /* MA <- eff addr */
++ if ((reason = Ea (IR))) /* MA <- eff addr */
+ break;
+ MB = AC;
+ reason = Write ();
+ break;
+
+ case 013: /* DAP */
+- if (reason = Ea (IR)) /* MA <- eff addr */
++ if ((reason = Ea (IR))) /* MA <- eff addr */
+ break;
+- if (reason = Read ()) /* MB <- data */
++ if ((reason = Read ())) /* MB <- data */
+ break;
+ MB = (AC & DAMASK) | (MB & ~DAMASK);
+ reason = Write ();
+ break;
+
+ case 014: /* DIP */
+- if (reason = Ea (IR)) /* MA <- eff addr */
++ if ((reason = Ea (IR))) /* MA <- eff addr */
+ break;
+- if (reason = Read ()) /* MB <- data */
++ if ((reason = Read ())) /* MB <- data */
+ break;
+ MB = (AC & ~DAMASK) | (MB & DAMASK);
+ reason = Write ();
+ break;
+
+ case 015: /* DIO */
+- if (reason = Ea (IR)) /* MA <- eff addr */
++ if ((reason = Ea (IR))) /* MA <- eff addr */
+ break;
+ MB = IO;
+ reason = Write ();
+ break;
+
+ case 016: /* DZM */
+- if (reason = Ea (IR)) /* MA <- eff addr */
++ if ((reason = Ea (IR))) /* MA <- eff addr */
+ break;
+ MB = 0;
+ reason = Write ();
+@@ -755,9 +755,9 @@ while (reason == 0) {
+
+ case 017: /* TAD */
+ if (cpu_unit.flags & UNIT_1D) { /* PDP-1D? */
+- if (reason = Ea (IR)) /* MA <- eff addr */
++ if ((reason = Ea (IR))) /* MA <- eff addr */
+ break;
+- if (reason = Read ()) /* MB <- data */
++ if ((reason = Read ())) /* MB <- data */
+ break;
+ AC = AC + MB + ((PF & PF_L)? 1: 0); /* AC + opnd + L */
+ if (AC > DMASK) /* carry? set L */
+@@ -769,9 +769,9 @@ while (reason == 0) {
+ break;
+
+ case 020: /* ADD */
+- if (reason = Ea (IR)) /* MA <- eff addr */
++ if ((reason = Ea (IR))) /* MA <- eff addr */
+ break;
+- if (reason = Read ()) /* MB <- data */
++ if ((reason = Read ())) /* MB <- data */
+ break;
+ t = AC;
+ AC = AC + MB;
+@@ -784,9 +784,9 @@ while (reason == 0) {
+ break;
+
+ case 021: /* SUB */
+- if (reason = Ea (IR)) /* MA <- eff addr */
++ if ((reason = Ea (IR))) /* MA <- eff addr */
+ break;
+- if (reason = Read ()) /* MB <- data */
++ if ((reason = Read ())) /* MB <- data */
+ break;
+ t = AC ^ DMASK; /* complement AC */
+ AC = t + MB; /* -AC + MB */
+@@ -798,9 +798,9 @@ while (reason == 0) {
+ break;
+
+ case 022: /* IDX */
+- if (reason = Ea (IR)) /* MA <- eff addr */
++ if ((reason = Ea (IR))) /* MA <- eff addr */
+ break;
+- if (reason = Read ()) /* MB <- data */
++ if ((reason = Read ())) /* MB <- data */
+ break;
+ AC = MB + 1;
+ if (AC >= DMASK)
+@@ -810,9 +810,9 @@ while (reason == 0) {
+ break;
+
+ case 023: /* ISP */
+- if (reason = Ea (IR)) /* MA <- eff addr */
++ if ((reason = Ea (IR))) /* MA <- eff addr */
+ break;
+- if (reason = Read ()) /* MB <- data */
++ if ((reason = Read ())) /* MB <- data */
+ break;
+ AC = MB + 1;
+ if (AC >= DMASK)
+@@ -824,18 +824,18 @@ while (reason == 0) {
+ break;
+
+ case 024: /* SAD */
+- if (reason = Ea (IR)) /* MA <- eff addr */
++ if ((reason = Ea (IR))) /* MA <- eff addr */
+ break;
+- if (reason = Read ()) /* MB <- data */
++ if ((reason = Read ())) /* MB <- data */
+ break;
+ if (AC != MB)
+ PC = INCR_ADDR (PC);
+ break;
+
+ case 025: /* SAS */
+- if (reason = Ea (IR)) /* MA <- eff addr */
++ if ((reason = Ea (IR))) /* MA <- eff addr */
+ break;
+- if (reason = Read ()) /* MB <- data */
++ if ((reason = Read ())) /* MB <- data */
+ break;
+ if (AC == MB)
+ PC = INCR_ADDR (PC);
+@@ -863,7 +863,7 @@ while (reason == 0) {
+ hst[hst_p].ea = PC;
+ }
+ else { /* normal JMP */
+- if (reason = Ea (IR)) /* MA <- eff addr */
++ if ((reason = Ea (IR))) /* MA <- eff addr */
+ break;
+ PCQ_ENTRY;
+ PC = MA;
+@@ -871,7 +871,7 @@ while (reason == 0) {
+ break;
+
+ case 031: /* JSP */
+- if (reason = Ea (IR)) /* MA <- eff addr */
++ if ((reason = Ea (IR))) /* MA <- eff addr */
+ break;
+ AC = EPC_WORD;
+ PCQ_ENTRY;
+@@ -889,9 +889,9 @@ while (reason == 0) {
+ */
+
+ case 026: /* MUL */
+- if (reason = Ea (IR)) /* MA <- eff addr */
++ if ((reason = Ea (IR))) /* MA <- eff addr */
+ break;
+- if (reason = Read ()) /* MB <- data */
++ if ((reason = Read ())) /* MB <- data */
+ break;
+ if (cpu_unit.flags & UNIT_MDV) { /* hardware? */
+ sign = AC ^ MB; /* result sign */
+@@ -919,9 +919,9 @@ while (reason == 0) {
+ break;
+
+ case 027: /* DIV */
+- if (reason = Ea (IR)) /* MA <- eff addr */
++ if ((reason = Ea (IR))) /* MA <- eff addr */
+ break;
+- if (reason = Read ()) /* MB <- data */
++ if ((reason = Read ())) /* MB <- data */
+ break;
+ if (cpu_unit.flags & UNIT_MDV) { /* hardware */
+ sign = AC ^ MB; /* result sign */
+@@ -1362,13 +1362,13 @@ t_stat r;
+ MA = (PC & EPCMASK) | (IR & DAMASK); /* direct address */
+ if (IR & IA) { /* indirect addr? */
+ if (extm) { /* extend? */
+- if (r = Read ()) /* read; err? */
++ if ((r = Read ())) /* read; err? */
+ return r;
+ MA = MB & AMASK; /* one level */
+ }
+ else { /* multi-level */
+ for (i = 0; i < ind_max; i++) { /* count indirects */
+- if (r = Read ()) /* get ind word */
++ if ((r = Read ())) /* get ind word */
+ return r;
+ MA = (PC & EPCMASK) | (MB & DAMASK);
+ if ((MB & IA) == 0)
+@@ -1392,12 +1392,12 @@ t_stat r;
+
+ MA = (PC & EPCMASK) | (IR & DAMASK); /* direct address */
+ if (extm) { /* extend? */
+- if (r = Read ()) /* read; err? */
++ if ((r = Read ())) /* read; err? */
+ return r;
+ }
+ else { /* multi-level */
+ for (i = 0; i < ind_max; i++) { /* count indirects */
+- if (r = Read ()) /* get ind word */
++ if ((r = Read ())) /* get ind word */
+ return r;
+ if ((MB & IA) == 0)
+ break;
diff --git a/emulators/simh/files/patch-PDP1_pdp1__dcs.c b/emulators/simh/files/patch-PDP1_pdp1__dcs.c
new file mode 100644
index 000000000000..fb4fe864e35f
--- /dev/null
+++ b/emulators/simh/files/patch-PDP1_pdp1__dcs.c
@@ -0,0 +1,11 @@
+--- PDP1/pdp1_dcs.c.orig 2016-12-01 22:43:42 UTC
++++ PDP1/pdp1_dcs.c
+@@ -251,7 +251,7 @@ if (ln >= 0) {
+ tmxr_poll_rx (&dcs_desc); /* poll for input */
+ for (ln = 0; ln < DCS_NUMLIN; ln++) { /* loop thru lines */
+ if (dcs_ldsc[ln].conn) { /* connected? */
+- if (c = tmxr_getc_ln (&dcs_ldsc[ln])) { /* get char */
++ if ((c = tmxr_getc_ln (&dcs_ldsc[ln]))) { /* get char */
+ if (c & SCPE_BREAK) /* break? */
+ c = 0;
+ else c = sim_tt_inpcvt (c, TT_GET_MODE (dcsl_unit[ln].flags)|TTUF_KSR);
diff --git a/emulators/simh/files/patch-PDP8_pdp8__cpu.c b/emulators/simh/files/patch-PDP8_pdp8__cpu.c
new file mode 100644
index 000000000000..2f85e127dff5
--- /dev/null
+++ b/emulators/simh/files/patch-PDP8_pdp8__cpu.c
@@ -0,0 +1,11 @@
+--- PDP8/pdp8_cpu.c.orig 2016-12-01 22:43:43 UTC
++++ PDP8/pdp8_cpu.c
+@@ -344,7 +344,7 @@ reason = 0;
+ while (reason == 0) { /* loop until halted */
+
+ if (sim_interval <= 0) { /* check clock queue */
+- if (reason = sim_process_event ())
++ if ((reason = sim_process_event ()))
+ break;
+ }
+
diff --git a/emulators/simh/files/patch-PDP8_pdp8__ct.c b/emulators/simh/files/patch-PDP8_pdp8__ct.c
new file mode 100644
index 000000000000..b2e7eda52f81
--- /dev/null
+++ b/emulators/simh/files/patch-PDP8_pdp8__ct.c
@@ -0,0 +1,38 @@
+--- PDP8/pdp8_ct.c.orig 2016-12-01 22:43:43 UTC
++++ PDP8/pdp8_ct.c
+@@ -270,7 +270,7 @@ switch (IR & 07) {
+
+ case 6: /* KGOA */
+ ct_df = 0; /* clear data flag */
+- if (uptr = ct_busy ()) /* op in progress? */
++ if ((uptr = ct_busy ())) /* op in progress? */
+ AC = ct_go_cont (uptr, AC); /* yes */
+ else AC = ct_go_start (AC); /* no, start */
+ ct_updsta (NULL);
+@@ -433,7 +433,7 @@ switch (uptr->FNC) {
+
+ case SRA_CRC: /* CRC */
+ if (ct_write) { /* write? */
+- if (st = sim_tape_wrrecf (uptr, ct_xb, ct_bptr)) /* write, err? */
++ if ((st = sim_tape_wrrecf (uptr, ct_xb, ct_bptr))) /* write, err? */
+ r = ct_map_err (uptr, st); /* map error */
+ break; /* write done */
+ }
+@@ -452,7 +452,7 @@ switch (uptr->FNC) {
+ break; /* read done */
+
+ case SRA_WFG: /* write file gap */
+- if (st = sim_tape_wrtmk (uptr)) /* write tmk, err? */
++ if ((st = sim_tape_wrtmk (uptr))) /* write tmk, err? */
+ r = ct_map_err (uptr, st); /* map error */
+ break;
+
+@@ -462,7 +462,7 @@ switch (uptr->FNC) {
+ break;
+
+ case SRA_SRB: /* space rev blk */
+- if (st = sim_tape_sprecr (uptr, &tbc)) /* space rev, err? */
++ if ((st = sim_tape_sprecr (uptr, &tbc))) /* space rev, err? */
+ r = ct_map_err (uptr, st); /* map error */
+ break;
+
diff --git a/emulators/simh/files/patch-PDP8_pdp8__mt.c b/emulators/simh/files/patch-PDP8_pdp8__mt.c
new file mode 100644
index 000000000000..3960c83ec251
--- /dev/null
+++ b/emulators/simh/files/patch-PDP8_pdp8__mt.c
@@ -0,0 +1,37 @@
+--- PDP8/pdp8_mt.c.orig 2016-12-01 22:43:43 UTC
++++ PDP8/pdp8_mt.c
+@@ -453,7 +453,7 @@ switch (f) {
+ mtxb[p++] = M[xma] & 077;
+ }
+ }
+- if (st = sim_tape_wrrecf (uptr, mtxb, tbc)) { /* write rec, err? */
++ if ((st = sim_tape_wrrecf (uptr, mtxb, tbc))) { /* write rec, err? */
+ r = mt_map_err (uptr, st); /* map error */
+ xma = GET_EMA (mt_cu) + mt_ca; /* restore xma */
+ }
+@@ -461,14 +461,14 @@ switch (f) {
+ break;
+
+ case FN_WREOF:
+- if (st = sim_tape_wrtmk (uptr)) /* write tmk, err? */
++ if ((st = sim_tape_wrtmk (uptr))) /* write tmk, err? */
+ r = mt_map_err (uptr, st); /* map error */
+ break;
+
+ case FN_SPACEF: /* space forward */
+ do {
+ mt_wc = (mt_wc + 1) & 07777; /* incr wc */
+- if (st = sim_tape_sprecf (uptr, &tbc)) { /* space rec fwd, err? */
++ if ((st = sim_tape_sprecf (uptr, &tbc))) { /* space rec fwd, err? */
+ r = mt_map_err (uptr, st); /* map error */
+ break; /* stop */
+ }
+@@ -478,7 +478,7 @@ switch (f) {
+ case FN_SPACER: /* space reverse */
+ do {
+ mt_wc = (mt_wc + 1) & 07777; /* incr wc */
+- if (st = sim_tape_sprecr (uptr, &tbc)) { /* space rec rev, err? */
++ if ((st = sim_tape_sprecr (uptr, &tbc))) { /* space rec rev, err? */
+ r = mt_map_err (uptr, st); /* map error */
+ break; /* stop */
+ }
diff --git a/emulators/simh/files/patch-PDP8_pdp8__ttx.c b/emulators/simh/files/patch-PDP8_pdp8__ttx.c
new file mode 100644
index 000000000000..cb8525b3b226
--- /dev/null
+++ b/emulators/simh/files/patch-PDP8_pdp8__ttx.c
@@ -0,0 +1,11 @@
+--- PDP8/pdp8_ttx.c.orig 2016-12-01 22:43:43 UTC
++++ PDP8/pdp8_ttx.c
+@@ -233,7 +233,7 @@ if (ln >= 0)
+ tmxr_poll_rx (&ttx_desc); /* poll for input */
+ for (ln = 0; ln < TTX_LINES; ln++) { /* loop thru lines */
+ if (ttx_ldsc[ln].conn) { /* connected? */
+- if (temp = tmxr_getc_ln (&ttx_ldsc[ln])) { /* get char */
++ if ((temp = tmxr_getc_ln (&ttx_ldsc[ln]))) { /* get char */
+ if (temp & SCPE_BREAK) /* break? */
+ c = 0;
+ else c = sim_tt_inpcvt (temp, TT_GET_MODE (ttox_unit[ln].flags));
diff --git a/emulators/simh/files/patch-S3_s3__cd.c b/emulators/simh/files/patch-S3_s3__cd.c
new file mode 100644
index 000000000000..e80aa32a11d6
--- /dev/null
+++ b/emulators/simh/files/patch-S3_s3__cd.c
@@ -0,0 +1,11 @@
+--- S3/s3_cd.c.orig 2016-12-01 22:43:43 UTC
++++ S3/s3_cd.c
+@@ -280,7 +280,7 @@ t_stat r;
+
+ if (sim_is_active (&cdr_unit)) { /* busy? */
+ sim_cancel (&cdr_unit); /* cancel */
+- if (r = cdr_svc (&cdr_unit)) return r; /* process */
++ if ((r = cdr_svc (&cdr_unit))) return r; /* process */
+ }
+
+ if (((cdp_unit.flags & UNIT_ATT) != 0 ||
diff --git a/emulators/simh/files/patch-S3_s3__cpu.c b/emulators/simh/files/patch-S3_s3__cpu.c
new file mode 100644
index 000000000000..f409ca248f8f
--- /dev/null
+++ b/emulators/simh/files/patch-S3_s3__cpu.c
@@ -0,0 +1,11 @@
+--- S3/s3_cpu.c.orig 2016-12-01 22:43:43 UTC
++++ S3/s3_cpu.c
+@@ -527,7 +527,7 @@ reason = 0;
+
+ while (reason == 0) { /* loop until halted */
+ if (sim_interval <= 0) { /* check clock queue */
+- if (reason = sim_process_event ()) break;
++ if ((reason = sim_process_event ())) break;
+ }
+
+ if (int_req) { /* interrupt? */
diff --git a/emulators/simh/files/patch-S3_s3__disk.c b/emulators/simh/files/patch-S3_s3__disk.c
new file mode 100644
index 000000000000..65bd5fcd368b
--- /dev/null
+++ b/emulators/simh/files/patch-S3_s3__disk.c
@@ -0,0 +1,47 @@
+--- S3/s3_disk.c.orig 2016-12-01 22:43:43 UTC
++++ S3/s3_disk.c
+@@ -298,7 +298,7 @@ int32 dsk (int32 disk, int32 op, int32 m
+ addr++;
+ }
+
+- if ((sect == 55) ) { /* HJS MODS */
++ if (sect == 55) { /* HJS MODS */
+ S = sect;
+ N = nsects - i - 2;
+ if (N > -1) diskerr[disk] |= 0x0020; /* end of cyl. */
+@@ -349,7 +349,7 @@ int32 dsk (int32 disk, int32 op, int32 m
+ diskerr[disk] |= 0x0800;
+ break;
+ }
+- if ((sect == 55) ) { /* HJS MODS */
++ if (sect == 55) { /* HJS MODS */
+ S = sect;
+ N = nsects - i - 2;
+ if (N > -1) diskerr[disk] |= 0x0020; /* end of cyl. */
+@@ -392,7 +392,7 @@ int32 dsk (int32 disk, int32 op, int32 m
+ diskerr[disk] |= 0x0400;
+ break;
+ }
+- if ((sect == 55) ) { /* HJS MODS */
++ if (sect == 55) { /* HJS MODS */
+ S = sect;
+ N = nsects - i - 2;
+ if (N > -1) diskerr[disk] |= 0x0020; /* end of cyl. */
+@@ -434,7 +434,7 @@ int32 dsk (int32 disk, int32 op, int32 m
+ diskerr[disk] |= 0x0400;
+ break;
+ }
+- if ((sect == 55) ) {
++ if (sect == 55) {
+ S = sect;
+ N = nsects - i - 2;
+ if (N > 0) diskerr[disk] |= 0x0020;
+@@ -486,7 +486,7 @@ int32 dsk (int32 disk, int32 op, int32 m
+ found[disk] = 1;
+ if (res == data)
+ break;
+- if ((sect == 55) ) { /* HJS MODS */
++ if (sect == 55) { /* HJS MODS */
+ S = sect;
+ N = nsects - i - 2;
+ if (N > -1) diskerr[disk] |= 0x0020; /* end of cyl. */
diff --git a/emulators/simh/files/patch-SDS_sds__cpu.c b/emulators/simh/files/patch-SDS_sds__cpu.c
new file mode 100644
index 000000000000..56ec38898c57
--- /dev/null
+++ b/emulators/simh/files/patch-SDS_sds__cpu.c
@@ -0,0 +1,533 @@
+--- SDS/sds_cpu.c.orig 2016-12-01 22:43:43 UTC
++++ SDS/sds_cpu.c
+@@ -385,14 +385,14 @@ while (reason == 0) {
+ }
+
+ if (sim_interval <= 0) { /* event queue? */
+- if (reason = sim_process_event ()) /* process */
++ if ((reason = sim_process_event ())) /* process */
+ break;
+ int_reqhi = api_findreq (); /* recalc int req */
+ chan_req = chan_testact (); /* recalc chan act */
+ }
+
+ if (chan_req) { /* channel request? */
+- if (reason = chan_process ()) /* process */
++ if ((reason = chan_process ())) /* process */
+ break;
+ int_reqhi = api_findreq (); /* recalc int req */
+ chan_req = chan_testact (); /* recalc chan act */
+@@ -506,7 +506,7 @@ if (inst & I_POP) {
+ }
+ else { /* normal POP */
+ dat = (OV << 23) | dat; /* ov in <0> */
+- if (r = Write (0, dat))
++ if ((r = Write (0, dat)))
+ return r;
+ }
+ }
+@@ -525,49 +525,49 @@ switch (op) {
+ /* Loads and stores */
+
+ case LDA:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &A)) /* get operand */
++ if ((r = Read (va, &A))) /* get operand */
+ return r;
+ break;
+
+ case LDB:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &B)) /* get operand */
++ if ((r = Read (va, &B))) /* get operand */
+ return r;
+ break;
+
+ case LDX:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &X)) /* get operand */
++ if ((r = Read (va, &X))) /* get operand */
+ return r;
+ break;
+
+ case STA:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Write (va, A)) /* write operand */
++ if ((r = Write (va, A))) /* write operand */
+ return r;
+ break;
+
+ case STB:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Write (va, B)) /* write operand */
++ if ((r = Write (va, B))) /* write operand */
+ return r;
+ break;
+
+ case STX:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Write (va, X)) /* write operand */
++ if ((r = Write (va, X))) /* write operand */
+ return r;
+ break;
+
+ case EAX:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+ if (nml_mode || usr_mode) /* normal or user? */
+ X = (X & ~VA_MASK) | (va & VA_MASK); /* only 14b */
+@@ -575,11 +575,11 @@ switch (op) {
+ break;
+
+ case XMA:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &dat)) /* get operand */
++ if ((r = Read (va, &dat))) /* get operand */
+ return r;
+- if (r = Write (va, A)) /* write A */
++ if ((r = Write (va, A))) /* write A */
+ return r;
+ A = dat; /* load A */
+ break;
+@@ -587,95 +587,95 @@ switch (op) {
+ /* Arithmetic and logical */
+
+ case ADD:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &dat)) /* get operand */
++ if ((r = Read (va, &dat))) /* get operand */
+ return r;
+ A = Add24 (A, dat, 0); /* add */
+ break;
+
+ case ADC:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &dat)) /* get operand */
++ if ((r = Read (va, &dat))) /* get operand */
+ return r;
+ OV = 0; /* clear overflow */
+ A = Add24 (A, dat, X >> 23); /* add with carry */
+ break;
+
+ case SUB:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &dat)) /* get operand */
++ if ((r = Read (va, &dat))) /* get operand */
+ return r;
+ A = Add24 (A, dat ^ DMASK, 1); /* subtract */
+ break;
+
+ case SUC:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &dat)) /* get operand */
++ if ((r = Read (va, &dat))) /* get operand */
+ return r;
+ OV = 0; /* clear overflow */
+ A = Add24 (A, dat ^ DMASK, X >> 23); /* sub with carry */
+ break;
+
+ case ADM:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &dat)) /* get operand */
++ if ((r = Read (va, &dat))) /* get operand */
+ return r;
+ dat = AddM24 (dat, A); /* mem + A */
+- if (r = Write (va, dat)) /* rewrite */
++ if ((r = Write (va, dat))) /* rewrite */
+ return r;
+ break;
+
+ case MIN:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &dat)) /* get operand */
++ if ((r = Read (va, &dat))) /* get operand */
+ return r;
+ dat = AddM24 (dat, 1); /* mem + 1 */
+- if (r = Write (va, dat)) /* rewrite */
++ if ((r = Write (va, dat))) /* rewrite */
+ return r;
+ break;
+
+ case MUL:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &dat)) /* get operand */
++ if ((r = Read (va, &dat))) /* get operand */
+ return r;
+ Mul48 (A, dat); /* multiply */
+ break;
+
+ case DIV:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &dat)) /* get operand */
++ if ((r = Read (va, &dat))) /* get operand */
+ return r;
+ Div48 (A, B, dat); /* divide */
+ break;
+
+ case ETR:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &dat)) /* get operand */
++ if ((r = Read (va, &dat))) /* get operand */
+ return r;
+ A = A & dat; /* and */
+ break;
+
+ case MRG:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &dat)) /* get operand */
++ if ((r = Read (va, &dat))) /* get operand */
+ return r;
+ A = A | dat; /* or */
+ break;
+
+ case EOR:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &dat)) /* get operand */
++ if ((r = Read (va, &dat))) /* get operand */
+ return r;
+ A = A ^ dat; /* xor */
+ break;
+@@ -683,75 +683,75 @@ switch (op) {
+ /* Skips */
+
+ case SKE:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &dat)) /* get operand */
++ if ((r = Read (va, &dat))) /* get operand */
+ return r;
+ if (A == dat) /* if A = op, skip */
+ P = (P + 1) & VA_MASK;
+ break;
+
+ case SKG:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &dat)) /* get operand */
++ if ((r = Read (va, &dat))) /* get operand */
+ return r;
+ if (SXT (A) > SXT (dat)) /* if A > op, skip */
+ P = (P + 1) & VA_MASK;
+ break;
+
+ case SKM:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &dat)) /* get operand */
++ if ((r = Read (va, &dat))) /* get operand */
+ return r;
+ if (((A ^ dat) & B) == 0) /* if A = op masked */
+ P = (P + 1) & VA_MASK;
+ break;
+
+ case SKA:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &dat)) /* get operand */
++ if ((r = Read (va, &dat))) /* get operand */
+ return r;
+ if ((A & dat) == 0) /* if !(A & op), skip */
+ P = (P + 1) & VA_MASK;
+ break;
+
+ case SKB:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &dat)) /* get operand */
++ if ((r = Read (va, &dat))) /* get operand */
+ return r;
+ if ((B & dat) == 0) /* if !(B & op), skip */
+ P = (P + 1) & VA_MASK;
+ break;
+
+ case SKN:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &dat)) /* get operand */
++ if ((r = Read (va, &dat))) /* get operand */
+ return r;
+ if (dat & SIGN) /* if op < 0, skip */
+ P = (P + 1) & VA_MASK;
+ break;
+
+ case SKR:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &dat)) /* get operand */
++ if ((r = Read (va, &dat))) /* get operand */
+ return r;
+ dat = AddM24 (dat, DMASK); /* decr operand */
+- if (r = Write (va, dat)) /* rewrite */
++ if ((r = Write (va, dat))) /* rewrite */
+ return r;
+ if (dat & SIGN) /* if op < 0, skip */
+ P = (P + 1) & VA_MASK;
+ break;
+
+ case SKD:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &dat)) /* get operand */
++ if ((r = Read (va, &dat))) /* get operand */
+ return r;
+ if (SXT_EXP (B) < SXT_EXP (dat)) { /* B < dat? */
+ X = (dat - B) & DMASK; /* X = dat - B */
+@@ -774,29 +774,29 @@ switch (op) {
+ exu_cnt = exu_cnt + 1; /* count chained EXU */
+ if (exu_cnt > exu_lim) /* too many? */
+ return STOP_EXULIM;
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &dat)) /* get operand */
++ if ((r = Read (va, &dat))) /* get operand */
+ return r;
+ inst = dat;
+ goto EXU_LOOP;
+
+ case BRU:
+ if (nml_mode && (inst & I_IND)) api_dismiss (); /* normal BRU*, dism */
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &dat)) /* get operand */
++ if ((r = Read (va, &dat))) /* get operand */
+ return r;
+ PCQ_ENTRY;
+ P = va & VA_MASK; /* branch */
+ break;
+
+ case BRX:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+ X = (X + 1) & DMASK; /* incr X */
+ if (X & I_IND) { /* bit 9 set? */
+- if (r = Read (va, &dat)) /* test dest access */
++ if ((r = Read (va, &dat))) /* test dest access */
+ return r;
+ PCQ_ENTRY;
+ P = va & VA_MASK; /* branch */
+@@ -804,22 +804,22 @@ switch (op) {
+ break;
+
+ case BRM:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+ dat = (EM3 << 18) | (EM2 << 15) | pc; /* form return word */
+ if (!nml_mode && !usr_mode) /* monitor mode? */
+ dat = dat | (mode << 23) | (OV << 21);
+ else dat = dat | (OV << 23); /* normal or user */
+- if (r = Write (va, dat)) /* write ret word */
++ if ((r = Write (va, dat))) /* write ret word */
+ return r;
+ PCQ_ENTRY;
+ P = (va + 1) & VA_MASK; /* branch */
+ break;
+
+ case BRR:
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &dat)) /* get operand */
++ if ((r = Read (va, &dat))) /* get operand */
+ return r;
+ PCQ_ENTRY;
+ P = (dat + 1) & VA_MASK; /* branch */
+@@ -837,9 +837,9 @@ switch (op) {
+ case BRI:
+ if (!nml_mode && usr_mode) /* priv inst */
+ return MM_PRVINS;
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &dat)) /* get operand */
++ if ((r = Read (va, &dat))) /* get operand */
+ return r;
+ api_dismiss (); /* dismiss hi api */
+ PCQ_ENTRY;
+@@ -909,7 +909,7 @@ switch (op) {
+ /* Shifts */
+
+ case RSH:
+- if (r = EaSh (inst, &va)) /* decode eff addr */
++ if ((r = EaSh (inst, &va))) /* decode eff addr */
+ return r;
+ shf_op = I_GETSHFOP (va); /* get eff op */
+ sc = va & I_SHFMSK; /* get eff count */
+@@ -934,7 +934,7 @@ switch (op) {
+ break;
+
+ case LSH:
+- if (r = EaSh (inst, &va)) /* decode eff addr */
++ if ((r = EaSh (inst, &va))) /* decode eff addr */
+ return r;
+ shf_op = I_GETSHFOP (va); /* get eff op */
+ sc = va & I_SHFMSK; /* get eff count */
+@@ -989,11 +989,11 @@ switch (op) {
+ case MIW: case MIY:
+ if (!nml_mode && usr_mode) /* priv inst */
+ return MM_PRVINS;
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &dat)) /* get operand */
++ if ((r = Read (va, &dat))) /* get operand */
+ return r;
+- if (r = op_miwy (inst, dat)) /* process inst */
++ if ((r = op_miwy (inst, dat))) /* process inst */
+ return r;
+ int_reqhi = api_findreq (); /* recalc int req */
+ chan_req = chan_testact (); /* recalc chan act */
+@@ -1002,11 +1002,11 @@ switch (op) {
+ case WIM: case YIM:
+ if (!nml_mode && usr_mode) /* priv inst */
+ return MM_PRVINS;
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = op_wyim (inst, &dat)) /* process inst */
++ if ((r = op_wyim (inst, &dat))) /* process inst */
+ return r;
+- if (r = Write (va, dat))
++ if ((r = Write (va, dat)))
+ return r; /* write result */
+ int_reqhi = api_findreq (); /* recalc int req */
+ chan_req = chan_testact (); /* recalc chan act */
+@@ -1015,7 +1015,7 @@ switch (op) {
+ case EOM: case EOD:
+ if (!nml_mode && usr_mode) /* priv inst */
+ return MM_PRVINS;
+- if (r = op_eomd (inst)) /* process inst */
++ if ((r = op_eomd (inst))) /* process inst */
+ return r;
+ int_reqhi = api_findreq (); /* recalc int req */
+ chan_req = chan_testact (); /* recalc chan act */
+@@ -1025,11 +1025,11 @@ switch (op) {
+ case POT:
+ if (!nml_mode && usr_mode) /* priv inst */
+ return MM_PRVINS;
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = Read (va, &dat)) /* get operand */
++ if ((r = Read (va, &dat))) /* get operand */
+ return r;
+- if (r = op_pot (dat)) /* process inst */
++ if ((r = op_pot (dat))) /* process inst */
+ return r;
+ int_reqhi = api_findreq (); /* recalc int req */
+ chan_req = chan_testact (); /* recalc chan act */
+@@ -1038,11 +1038,11 @@ switch (op) {
+ case PIN:
+ if (!nml_mode && usr_mode) /* priv inst */
+ return MM_PRVINS;
+- if (r = Ea (inst, &va)) /* decode eff addr */
++ if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+- if (r = op_pin (&dat)) /* process inst */
++ if ((r = op_pin (&dat))) /* process inst */
+ return r;
+- if (r = Write (va, dat)) /* write result */
++ if ((r = Write (va, dat))) /* write result */
+ return r;
+ int_reqhi = api_findreq (); /* recalc int req */
+ chan_req = chan_testact (); /* recalc chan act */
+@@ -1051,7 +1051,7 @@ switch (op) {
+ case SKS:
+ if (!nml_mode && usr_mode) /* priv inst */
+ return MM_PRVINS;
+- if (r = op_sks (inst, &dat)) /* process inst */
++ if ((r = op_sks (inst, &dat))) /* process inst */
+ return r;
+ if (dat)
+ P = (P + 1) & VA_MASK;
+@@ -1085,7 +1085,7 @@ for (i = 0; i < ind_lim; i++) {
+ hst[hst_p].ea = *addr;
+ return SCPE_OK;
+ }
+- if (r = Read (va, &wd)) /* read ind; fails? */
++ if ((r = Read (va, &wd))) /* read ind; fails? */
+ return r;
+ va = (va & VA_USR) | (wd & XVA_MASK);
+ }
+@@ -1112,7 +1112,7 @@ for (i = 0; i < ind_lim; i++) {
+ }
+ if (wd & I_IDX)
+ va = (va & VA_USR) | ((va + X) & VA_MASK);
+- if (r = Read (va, &wd)) /* read ind; fails? */
++ if ((r = Read (va, &wd))) /* read ind; fails? */
+ return r;
+ va = (va & VA_USR) | (wd & XVA_MASK);
+ }
+@@ -1341,7 +1341,7 @@ if (sc >= 24) {
+ A = sgn;
+ }
+ else {
+- B = ((B >> sc) | (A << (24 - sc)) & DMASK);
++ B = ((B >> sc) | (A << (24 - sc))) & DMASK;
+ A = ((A >> sc) | (sgn << (24 - sc))) & DMASK;
+ }
+ return;
+@@ -1569,12 +1569,12 @@ if (op == MIN)
+ else if (op == SKR) /* decr */
+ val = DMASK;
+ else return STOP_RTCINS; /* can't do it */
+-if (r = Ea (inst, &va)) /* decode eff addr */
++if ((r = Ea (inst, &va))) /* decode eff addr */
+ return r;
+-if (r = Read (va, &dat)) /* get operand */
++if ((r = Read (va, &dat))) /* get operand */
+ return r;
+ dat = AddM24 (dat, val); /* mem +/- 1 */
+-if (r = Write (va, dat)) /* rewrite */
++if ((r = Write (va, dat))) /* rewrite */
+ return r;
+ if (dat == 0) /* set clk sync int */
+ int_req = int_req | INT_RTCS;
diff --git a/emulators/simh/files/patch-SDS_sds__dsk.c b/emulators/simh/files/patch-SDS_sds__dsk.c
new file mode 100644
index 000000000000..3e1d49baaff0
--- /dev/null
+++ b/emulators/simh/files/patch-SDS_sds__dsk.c
@@ -0,0 +1,20 @@
+--- SDS/sds_dsk.c.orig 2016-12-01 22:43:43 UTC
++++ SDS/sds_dsk.c
+@@ -204,7 +204,7 @@ switch (fnc) {
+ case IO_READ:
+ xfr_req = xfr_req & ~XFR_DSK; /* clr xfr req */
+ if (dsk_bptr >= dsk_blnt) { /* no more data? */
+- if (r = dsk_read_buf (inst)) /* read sector */
++ if ((r = dsk_read_buf (inst))) /* read sector */
+ return r;
+ }
+ dsk_wptr = dsk_bptr >> 2; /* word pointer */
+@@ -219,7 +219,7 @@ switch (fnc) {
+ case IO_WRITE:
+ xfr_req = xfr_req & ~XFR_DSK; /* clr xfr req */
+ if (dsk_bptr >= (DSK_NUMWD * 4)) { /* full? */
+- if (r = dsk_write_buf (inst)) /* write sector */
++ if ((r = dsk_write_buf (inst))) /* write sector */
+ return r;
+ }
+ dsk_wptr = dsk_bptr >> 2; /* word pointer */
diff --git a/emulators/simh/files/patch-SDS_sds__io.c b/emulators/simh/files/patch-SDS_sds__io.c
new file mode 100644
index 000000000000..7c480454dd87
--- /dev/null
+++ b/emulators/simh/files/patch-SDS_sds__io.c
@@ -0,0 +1,20 @@
+--- SDS/sds_io.c.orig 2016-12-01 22:43:43 UTC
++++ SDS/sds_io.c
+@@ -336,7 +336,7 @@ switch (mod) {
+ chan_mode[ch] = chan_uar[ch] = 0;
+ if (ch >= CHAN_E)
+ chan_mode[ch] = CHM_CE;
+- if (r = dev_dsp[dev][ch] (IO_CONN, inst, NULL)) /* connect */
++ if ((r = dev_dsp[dev][ch] (IO_CONN, inst, NULL))) /* connect */
+ return r;
+ if ((inst & I_IND) || (ch >= CHAN_C)) { /* C-H? alert ilc */
+ alert = POT_ILCY + ch;
+@@ -958,7 +958,7 @@ for (i = 0; i < NUM_CHAN; i++) {
+
+ /* Test each device for conflict; add to map; init tables */
+
+-for (i = 0; dptr = sim_devices[i]; i++) { /* loop thru devices */
++for (i = 0; (dptr = sim_devices[i]); i++) { /* loop thru devices */
+ dibp = (DIB *) dptr->ctxt; /* get DIB */
+ if ((dibp == NULL) || (dptr->flags & DEV_DIS)) /* exist, enabled? */
+ continue;
diff --git a/emulators/simh/files/patch-SDS_sds__lp.c b/emulators/simh/files/patch-SDS_sds__lp.c
new file mode 100644
index 000000000000..230f7d1d27f1
--- /dev/null
+++ b/emulators/simh/files/patch-SDS_sds__lp.c
@@ -0,0 +1,11 @@
+--- SDS/sds_lp.c.orig 2016-12-01 22:43:43 UTC
++++ SDS/sds_lp.c
+@@ -177,7 +177,7 @@ switch (fnc) {
+ t = I_GETSKCND (inst); /* sks cond */
+ if (((t == 020) && (!CHP (7, lpt_cct[lpt_ccp]))) || /* 14062: !ch 7 */
+ ((t == 010) && (lpt_unit.flags & UNIT_ATT)) || /* 12062: !online */
+- (t == 004) && !lpt_err) /* 11062: !err */
++ ((t == 004) && !lpt_err)) /* 11062: !err */
+ *dat = 1;
+ break;
+
diff --git a/emulators/simh/files/patch-SDS_sds__mt.c b/emulators/simh/files/patch-SDS_sds__mt.c
new file mode 100644
index 000000000000..44d449abdf37
--- /dev/null
+++ b/emulators/simh/files/patch-SDS_sds__mt.c
@@ -0,0 +1,19 @@
+--- SDS/sds_mt.c.orig 2016-12-01 22:43:43 UTC
++++ SDS/sds_mt.c
+@@ -235,14 +235,14 @@ switch (fnc) {
+ case IO_DISC: /* disconnect */
+ sim_cancel (uptr); /* no more xfr's */
+ if (inst & DEV_OUT) { /* write? */
+- if (r = mt_wrend (inst)) /* end record */
++ if ((r = mt_wrend (inst))) /* end record */
+ return r;
+ }
+ break;
+
+ case IO_WREOR: /* write eor */
+ chan_set_flag (mt_dib.chan, CHF_EOR); /* set eor flg */
+- if (r = mt_wrend (inst)) /* end record */
++ if ((r = mt_wrend (inst))) /* end record */
+ return r;
+ mt_gap = 1; /* in gap */
+ sim_activate (uptr, mt_gtime); /* start timer */
diff --git a/emulators/simh/files/patch-SDS_sds__mux.c b/emulators/simh/files/patch-SDS_sds__mux.c
new file mode 100644
index 000000000000..824b6ef43af2
--- /dev/null
+++ b/emulators/simh/files/patch-SDS_sds__mux.c
@@ -0,0 +1,11 @@
+--- SDS/sds_mux.c.orig 2016-12-01 22:43:43 UTC
++++ SDS/sds_mux.c
+@@ -363,7 +363,7 @@ if (ln >= 0) {
+ tmxr_poll_rx (&mux_desc); /* poll for input */
+ for (ln = 0; ln < MUX_NUMLIN; ln++) { /* loop thru lines */
+ if (mux_ldsc[ln].conn) { /* connected? */
+- if (c = tmxr_getc_ln (&mux_ldsc[ln])) { /* get char */
++ if ((c = tmxr_getc_ln (&mux_ldsc[ln]))) { /* get char */
+ if (mux_sta[ln] & MUX_SCHP) /* already got one? */
+ mux_sta[ln] = mux_sta[ln] | MUX_SOVR; /* overrun */
+ else mux_sta[ln] = mux_sta[ln] | MUX_SCHP; /* char pending */
diff --git a/emulators/simh/files/patch-SDS_sds__stddev.c b/emulators/simh/files/patch-SDS_sds__stddev.c
new file mode 100644
index 000000000000..b6e2991106f2
--- /dev/null
+++ b/emulators/simh/files/patch-SDS_sds__stddev.c
@@ -0,0 +1,11 @@
+--- SDS/sds_stddev.c.orig 2016-12-01 22:43:43 UTC
++++ SDS/sds_stddev.c
+@@ -395,7 +395,7 @@ t_stat r = SCPE_OK;
+
+ if (ptp_ldr) { /* need leader? */
+ for (i = 0; i < 12; i++) { /* punch leader */
+- if (r = ptp_out (0))
++ if ((r = ptp_out (0)))
+ break;
+ }
+ }
diff --git a/emulators/simh/files/patch-VAX-vax_sysdev.c b/emulators/simh/files/patch-VAX-vax_sysdev.c
deleted file mode 100644
index e4c27e87c492..000000000000
--- a/emulators/simh/files/patch-VAX-vax_sysdev.c
+++ /dev/null
@@ -1,19 +0,0 @@
---- VAX/vax_sysdev.c.orig 2012-05-05 22:40:08.000000000 +0900
-+++ VAX/vax_sysdev.c 2012-05-05 22:43:28.000000000 +0900
-@@ -1556,8 +1556,14 @@
- if (sim_log)
- fprintf (sim_log, "Loading boot code from ka655x.bin\n");
- r = load_cmd (0, "-R ka655x.bin");
-- if (r != SCPE_OK)
-- return r;
-+ if (r != SCPE_OK) {
-+ printf ("Loading boot code from %%DATADIR%%/ka655x.bin\n");
-+ if (sim_log)
-+ fprintf (sim_log, "Loading boot code from %%DATADIR%%/ka655x.bin\n");
-+ r = load_cmd (0, "-R %%DATADIR%%/ka655x.bin");
-+ if (r != SCPE_OK)
-+ return r;
-+ }
- }
- sysd_powerup ();
- return SCPE_OK;
diff --git a/emulators/simh/files/patch-VAX_vax780__sbi.c b/emulators/simh/files/patch-VAX_vax780__sbi.c
new file mode 100644
index 000000000000..24b8260c5a3d
--- /dev/null
+++ b/emulators/simh/files/patch-VAX_vax780__sbi.c
@@ -0,0 +1,30 @@
+--- VAX/vax780_sbi.c.orig 2016-12-01 22:43:43 UTC
++++ VAX/vax780_sbi.c
+@@ -638,7 +638,7 @@ DIB *dibp;
+ t_stat r;
+
+ regptr = get_glyph (ptr, gbuf, 0); /* get glyph */
+-if (slptr = strchr (gbuf, '/')) { /* found slash? */
++if ((slptr = strchr (gbuf, '/'))) { /* found slash? */
+ regptr = strchr (ptr, '/'); /* locate orig */
+ *slptr = 0; /* zero in string */
+ }
+@@ -784,15 +784,15 @@ for (i = 0; (dptr = sim_devices[i]) != N
+ dibp = (DIB *) dptr->ctxt; /* get DIB */
+ if (dibp && !(dptr->flags & DEV_DIS)) { /* defined, enabled? */
+ if (dptr->flags & DEV_NEXUS) { /* Nexus? */
+- if (r = build_nexus_tab (dptr, dibp)) /* add to dispatch table */
++ if ((r = build_nexus_tab (dptr, dibp))) /* add to dispatch table */
+ return r;
+ }
+ else if (dptr->flags & DEV_MBUS) { /* Massbus? */
+- if (r = build_mbus_tab (dptr, dibp))
++ if ((r = build_mbus_tab (dptr, dibp)))
+ return r;
+ }
+ else { /* no, Unibus device */
+- if (r = build_ubus_tab (dptr, dibp)) /* add to dispatch tab */
++ if ((r = build_ubus_tab (dptr, dibp))) /* add to dispatch tab */
+ return r;
+ } /* end else */
+ } /* end if enabled */
diff --git a/emulators/simh/files/patch-VAX_vax__cis.c b/emulators/simh/files/patch-VAX_vax__cis.c
new file mode 100644
index 000000000000..f4e64bec4465
--- /dev/null
+++ b/emulators/simh/files/patch-VAX_vax__cis.c
@@ -0,0 +1,29 @@
+--- VAX/vax_cis.c.orig 2016-12-01 22:43:43 UTC
++++ VAX/vax_cis.c
+@@ -331,7 +331,7 @@ switch (opc) {
+ R[3] = (R[3] + 1) & LMASK; /* next string char */
+ if (i >= sim_interval) { /* done with interval? */
+ sim_interval = 0;
+- if (r = sim_process_event ()) { /* presumably WRU */
++ if ((r = sim_process_event ())) { /* presumably WRU */
+ PC = fault_PC; /* backup up PC */
+ ABORT (r); /* abort flushes IB */
+ }
+@@ -1550,7 +1550,7 @@ uint32 NibbleRshift (DSTR *dsrc, int32 s
+ {
+ int32 i, s, nc;
+
+-if (s = sc * 4) {
++if ((s = sc * 4)) {
+ for (i = DSTRMAX; i >= 0; i--) {
+ nc = (dsrc->val[i] << (32 - s)) & LMASK;
+ dsrc->val[i] = ((dsrc->val[i] >> s) |
+@@ -1574,7 +1574,7 @@ uint32 NibbleLshift (DSTR *dsrc, int32 s
+ {
+ int32 i, s, nc;
+
+-if (s = sc * 4) {
++if ((s = sc * 4)) {
+ for (i = 0; i < DSTRLNT; i++) {
+ nc = dsrc->val[i] >> (32 - s);
+ dsrc->val[i] = ((dsrc->val[i] << s) |
diff --git a/emulators/simh/files/patch-VAX_vax__cmode.c b/emulators/simh/files/patch-VAX_vax__cmode.c
new file mode 100644
index 000000000000..f7b4cc5e4d21
--- /dev/null
+++ b/emulators/simh/files/patch-VAX_vax__cmode.c
@@ -0,0 +1,11 @@
+--- VAX/vax_cmode.c.orig 2016-12-01 22:43:43 UTC
++++ VAX/vax_cmode.c
+@@ -621,7 +621,7 @@ switch ((IR >> 12) & 017) {
+ else src2 = RdMemW (GeteaW (dstspec));
+ src2 = src2 & 077;
+ src = RdRegW (srcspec); /* get src */
+- if (sign = ((src & WSIGN)? 1: 0))
++ if ((sign = ((src & WSIGN)? 1: 0)))
+ src = src | ~WMASK;
+ if (src2 == 0) { /* [0] */
+ dst = src; /* result */
diff --git a/emulators/simh/files/patch-VAX_vax__cpu.c b/emulators/simh/files/patch-VAX_vax__cpu.c
new file mode 100644
index 000000000000..7f5945e6fbf3
--- /dev/null
+++ b/emulators/simh/files/patch-VAX_vax__cpu.c
@@ -0,0 +1,20 @@
+--- VAX/vax_cpu.c.orig 2016-12-01 22:43:43 UTC
++++ VAX/vax_cpu.c
+@@ -642,7 +642,7 @@ for ( ;; ) {
+ */
+
+ if (trpirq) { /* trap or interrupt? */
+- if (temp = GET_TRAP (trpirq)) { /* trap? */
++ if ((temp = GET_TRAP (trpirq))) { /* trap? */
+ cc = intexc (SCB_ARITH, cc, 0, IE_EXC); /* take, clear trap */
+ GET_CUR; /* set cur mode */
+ in_ie = 1;
+@@ -650,7 +650,7 @@ for ( ;; ) {
+ SP = SP - 4;
+ in_ie = 0;
+ }
+- else if (temp = GET_IRQL (trpirq)) { /* interrupt? */
++ else if ((temp = GET_IRQL (trpirq))) { /* interrupt? */
+ int32 vec;
+ if (temp == IPL_HLTPIN) { /* console halt? */
+ hlt_pin = 0; /* clear intr */
diff --git a/emulators/simh/files/patch-VAX_vax__io.c b/emulators/simh/files/patch-VAX_vax__io.c
new file mode 100644
index 000000000000..c094d03d9449
--- /dev/null
+++ b/emulators/simh/files/patch-VAX_vax__io.c
@@ -0,0 +1,11 @@
+--- VAX/vax_io.c.orig 2016-12-01 22:43:43 UTC
++++ VAX/vax_io.c
+@@ -792,7 +792,7 @@ init_ubus_tab ();
+ for (i = 0; (dptr = sim_devices[i]) != NULL; i++) { /* loop thru dev */
+ dibp = (DIB *) dptr->ctxt; /* get DIB */
+ if (dibp && !(dptr->flags & DEV_DIS)) { /* defined, enabled? */
+- if (r = build_ubus_tab (dptr, dibp)) /* add to bus tab */
++ if ((r = build_ubus_tab (dptr, dibp))) /* add to bus tab */
+ return r;
+ } /* end if enabled */
+ } /* end for */
diff --git a/emulators/simh/files/patch-VAX_vax__octa.c b/emulators/simh/files/patch-VAX_vax__octa.c
new file mode 100644
index 000000000000..87fdb2430dbd
--- /dev/null
+++ b/emulators/simh/files/patch-VAX_vax__octa.c
@@ -0,0 +1,20 @@
+--- VAX/vax_octa.c.orig 2016-12-01 22:43:43 UTC
++++ VAX/vax_octa.c
+@@ -187,7 +187,7 @@ switch (opc) {
+ break;
+
+ case MOVH:
+- if (r = op_tsth (opnd[0])) { /* test for 0 */
++ if ((r = op_tsth (opnd[0]))) { /* test for 0 */
+ h_write_o (spec, va, opnd, acc); /* nz, write result */
+ CC_IIZP_FP (r); /* set cc's */
+ }
+@@ -198,7 +198,7 @@ switch (opc) {
+ break;
+
+ case MNEGH:
+- if (r = op_tsth (opnd[0])) { /* test for 0 */
++ if ((r = op_tsth (opnd[0]))) { /* test for 0 */
+ opnd[0] = opnd[0] ^ FPSIGN; /* nz, invert sign */
+ h_write_o (spec, va, opnd, acc); /* write result */
+ CC_IIZZ_FP (opnd[0]); /* set cc's */
diff --git a/emulators/simh/files/patch-VAX_vax__sys.c b/emulators/simh/files/patch-VAX_vax__sys.c
new file mode 100644
index 000000000000..dc47a9e51ff2
--- /dev/null
+++ b/emulators/simh/files/patch-VAX_vax__sys.c
@@ -0,0 +1,11 @@
+--- VAX/vax_sys.c.orig 2016-12-01 22:43:43 UTC
++++ VAX/vax_sys.c
+@@ -1173,7 +1173,7 @@ const char *force[] = { "S^", "I^", "B^"
+
+ *r = SCPE_OK; /* assume ok */
+ M1C ('@', SP_IND); /* look for @ */
+-if (tptr = parse_rnum (cptr, &rn)) { /* look for Rn */
++if ((tptr = parse_rnum (cptr, &rn))) { /* look for Rn */
+ if (*cptr == '[') { /* look for [Rx] */
+ cptr = parse_rnum (++cptr, &index);
+ if ((cptr == NULL) || (*cptr++ != ']'))
diff --git a/emulators/simh/files/patch-VAX_vax__sysdev.c b/emulators/simh/files/patch-VAX_vax__sysdev.c
new file mode 100644
index 000000000000..517a2144b974
--- /dev/null
+++ b/emulators/simh/files/patch-VAX_vax__sysdev.c
@@ -0,0 +1,19 @@
+--- VAX/vax_sysdev.c.orig 2016-12-01 22:43:43 UTC
++++ VAX/vax_sysdev.c
+@@ -1556,8 +1556,14 @@ if (*rom == 0) {
+ if (sim_log)
+ fprintf (sim_log, "Loading boot code from ka655x.bin\n");
+ r = load_cmd (0, "-R ka655x.bin");
+- if (r != SCPE_OK)
+- return r;
++ if (r != SCPE_OK) {
++ printf ("Loading boot code from /usr/local/share/simh/ka655x.bin\n");
++ if (sim_log)
++ fprintf (sim_log, "Loading boot code from /usr/local/share/simh/ka655x.bin\n");
++ r = load_cmd (0, "-R /usr/local/share/simh/ka655x.bin");
++ if (r != SCPE_OK)
++ return r;
++ }
+ }
+ sysd_powerup ();
+ return SCPE_OK;
diff --git a/emulators/simh/files/patch-makefile b/emulators/simh/files/patch-makefile
index c82ad74e8401..22a56620e410 100644
--- a/emulators/simh/files/patch-makefile
+++ b/emulators/simh/files/patch-makefile
@@ -1,15 +1,54 @@
---- makefile.orig 2012-04-23 16:28:04.000000000 +0200
-+++ makefile 2016-01-19 20:21:21.371550000 +0100
-@@ -332,8 +332,10 @@
+--- makefile.orig 2016-12-01 22:43:43 UTC
++++ makefile
+@@ -110,7 +110,7 @@ ifeq ($(WIN32),) #*nix Environments (&&
+ PCAPLIB = wpcap
+ LIBEXT = a
+ else
+- LDSEARCH :=$(shell ldconfig -r | grep 'search directories' | awk '{print $$3}' | sed 's/:/ /g')
++########## LDSEARCH :=$(shell ldconfig -r | grep 'search directories' | awk '{print $$3}' | sed 's/:/ /g')
+ ifneq (,$(LDSEARCH))
+ LIBPATH := $(LDSEARCH)
+ endif
+@@ -300,7 +300,7 @@ ifneq ($(DEBUG),)
+ CFLAGS_O = -O0
+ BUILD_FEATURES = - debugging support
+ else
+- CFLAGS_O = -O2
++ CFLAGS_O ?= -O2
+ LDFLAGS_O =
+ GCC_MAJOR_VERSION = $(firstword $(subst ., ,$(GCC_VERSION)))
+ ifneq (3,$(GCC_MAJOR_VERSION))
+@@ -309,9 +309,9 @@ else
+ endif
+ GCC_OPTIMIZERS = $(shell $(GCC_OPTIMIZERS_CMD))
+ endif
+- ifneq (,$(findstring $(GCC_VERSION),$(LTO_EXCLUDE_VERSIONS)))
+- NO_LTO = 1
+- endif
++# ifneq (,$(findstring $(GCC_VERSION),$(LTO_EXCLUDE_VERSIONS)))
++# NO_LTO = 1
++# endif
+ ifneq (,$(findstring -finline-functions,$(GCC_OPTIMIZERS)))
+ CFLAGS_O += -finline-functions
+ endif
+@@ -330,12 +330,14 @@ else
+ ifneq (,$(findstring -fstrict-overflow,$(GCC_OPTIMIZERS)))
+ CFLAGS_O += -fno-strict-overflow
endif
- ifeq (,$(NO_LTO))
- ifneq (,$(findstring -flto,$(GCC_OPTIMIZERS)))
+- ifeq (,$(NO_LTO))
+- ifneq (,$(findstring -flto,$(GCC_OPTIMIZERS)))
- CFLAGS_O += -flto -fwhole-program
- LDFLAGS_O += -flto -fwhole-program
-+ ifneq (,$(findstring -fwhole-program,$(GCC_OPTIMIZERS)))
-+ CFLAGS_O += -flto -fwhole-program
-+ LDFLAGS_O += -flto -fwhole-program
-+ endif
- endif
- endif
+- endif
+- endif
++# ifeq (,$(NO_LTO))
++# ifneq (,$(findstring -flto,$(GCC_OPTIMIZERS)))
++# ifneq (,$(findstring -fwhole-program,$(GCC_OPTIMIZERS)))
++# CFLAGS_O += -flto -fwhole-program
++# LDFLAGS_O += -flto -fwhole-program
++# endif
++# endif
++# endif
BUILD_FEATURES = - compiler optimizations and no debugging support
+ endif
+ ifneq (3,$(GCC_MAJOR_VERSION))
diff --git a/emulators/simh/files/patch-scp.c b/emulators/simh/files/patch-scp.c
new file mode 100644
index 000000000000..87ded0afee9c
--- /dev/null
+++ b/emulators/simh/files/patch-scp.c
@@ -0,0 +1,196 @@
+--- scp.c.orig 2016-12-01 22:43:43 UTC
++++ scp.c
+@@ -678,14 +678,14 @@ else if (*argv[0]) {
+ char nbuf[PATH_MAX + 7], *np; /* "path.ini" */
+ nbuf[0] = '"'; /* starting " */
+ strncpy (nbuf + 1, argv[0], PATH_MAX + 1); /* copy sim name */
+- if (np = match_ext (nbuf, "EXE")) /* remove .exe */
++ if ((np = match_ext (nbuf, "EXE"))) /* remove .exe */
+ *np = 0;
+ strcat (nbuf, ".ini\""); /* add .ini" */
+ stat = do_cmd (-1, nbuf); /* proc cmd file */
+ }
+
+ while (stat != SCPE_EXIT) { /* in case exit */
+- if (cptr = sim_brk_getact (cbuf, CBUFSIZE)) /* pending action? */
++ if ((cptr = sim_brk_getact (cbuf, CBUFSIZE))) /* pending action? */
+ printf ("sim> %s\n", cptr); /* echo */
+ else if (sim_vm_read != NULL) { /* sim routine? */
+ printf ("sim> "); /* prompt */
+@@ -700,7 +700,7 @@ while (stat != SCPE_EXIT) {
+ fprintf (sim_log, "sim> %s\n", cptr);
+ cptr = get_glyph (cptr, gbuf, 0); /* get command glyph */
+ sim_switches = 0; /* init switches */
+- if (cmdp = find_cmd (gbuf)) /* lookup command */
++ if ((cmdp = find_cmd (gbuf))) /* lookup command */
+ stat = cmdp->action (cmdp->arg, cptr); /* if found, exec */
+ else stat = SCPE_UNK;
+ if (stat >= SCPE_BASE) { /* error? */
+@@ -767,7 +767,7 @@ if (*cptr) {
+ cptr = get_glyph (cptr, gbuf, 0);
+ if (*cptr)
+ return SCPE_2MARG;
+- if (cmdp = find_cmd (gbuf)) {
++ if ((cmdp = find_cmd (gbuf))) {
+ fputs (cmdp->help, stdout);
+ if (sim_log)
+ fputs (cmdp->help, sim_log);
+@@ -911,7 +911,7 @@ do {
+ cptr = get_glyph (cptr, gbuf, 0); /* get command glyph */
+ sim_switches = 0; /* init switches */
+ isdo = FALSE;
+- if (cmdp = find_cmd (gbuf)) { /* lookup command */
++ if ((cmdp = find_cmd (gbuf))) { /* lookup command */
+ isdo = (cmdp->action == &do_cmd);
+ if (isdo) { /* DO command? */
+ if (flag >= DO_NEST_LVL) /* nest too deep? */
+@@ -1091,18 +1091,18 @@ if (*cptr == 0)
+ return SCPE_2FARG;
+ cptr = get_glyph (cptr, gbuf, 0); /* get glob/dev/unit */
+
+-if (dptr = find_dev (gbuf)) { /* device match? */
++if ((dptr = find_dev (gbuf))) { /* device match? */
+ uptr = dptr->units; /* first unit */
+ ctbr = set_dev_tab; /* global table */
+ lvl = MTAB_VDV; /* device match */
+ }
+-else if (dptr = find_unit (gbuf, &uptr)) { /* unit match? */
++else if ((dptr = find_unit (gbuf, &uptr))) { /* unit match? */
+ if (uptr == NULL) /* invalid unit */
+ return SCPE_NXUN;
+ ctbr = set_unit_tab; /* global table */
+ lvl = MTAB_VUN; /* unit match */
+ }
+-else if (gcmdp = find_ctab (set_glob_tab, gbuf)) /* global? */
++else if ((gcmdp = find_ctab (set_glob_tab, gbuf))) /* global? */
+ return gcmdp->action (gcmdp->arg, cptr); /* do the rest */
+ else return SCPE_NXDEV; /* no match */
+ if (*cptr == 0) /* must be more */
+@@ -1110,7 +1110,7 @@ if (*cptr == 0)
+
+ while (*cptr != 0) { /* do all mods */
+ cptr = get_glyph (svptr = cptr, gbuf, ','); /* get modifier */
+- if (cvptr = strchr (gbuf, '=')) /* = value? */
++ if ((cvptr = strchr (gbuf, '='))) /* = value? */
+ *cvptr++ = 0;
+ for (mptr = dptr->modifiers; mptr && (mptr->mask != 0); mptr++) {
+ if ((mptr->mstring) && /* match string */
+@@ -1123,7 +1123,7 @@ while (*cptr != 0) {
+ if (mptr->valid) { /* validation rtn? */
+ if (cvptr && (mptr->mask & MTAB_NC)) {
+ get_glyph_nc (svptr, gbuf, ',');
+- if (cvptr = strchr (gbuf, '='))
++ if ((cvptr = strchr (gbuf, '=')))
+ *cvptr++ = 0;
+ }
+ r = mptr->valid (uptr, mptr->match, cvptr, mptr->desc);
+@@ -1156,7 +1156,7 @@ while (*cptr != 0) {
+ } /* end if match */
+ } /* end for */
+ if (!mptr || (mptr->mask == 0)) { /* no match? */
+- if (glbr = find_c1tab (ctbr, gbuf)) { /* global match? */
++ if ((glbr = find_c1tab (ctbr, gbuf))) { /* global match? */
+ r = glbr->action (dptr, uptr, glbr->arg, cvptr); /* do global */
+ if (r != SCPE_OK)
+ return r;
+@@ -1349,15 +1349,15 @@ GET_SWITCHES (cptr);
+ if (*cptr == 0) /* must be more */
+ return SCPE_2FARG;
+ cptr = get_glyph (cptr, gbuf, 0); /* get next glyph */
+-if (shptr = find_shtab (show_glob_tab, gbuf)) /* global? */
++if ((shptr = find_shtab (show_glob_tab, gbuf))) /* global? */
+ return shptr->action (ofile, NULL, NULL, shptr->arg, cptr);
+
+-if (dptr = find_dev (gbuf)) { /* device match? */
++if ((dptr = find_dev (gbuf))) { /* device match? */
+ uptr = dptr->units; /* first unit */
+ shtb = show_dev_tab; /* global table */
+ lvl = MTAB_VDV; /* device match */
+ }
+-else if (dptr = find_unit (gbuf, &uptr)) { /* unit match? */
++else if ((dptr = find_unit (gbuf, &uptr))) { /* unit match? */
+ if (uptr == NULL) /* invalid unit */
+ return SCPE_NXUN;
+ if (uptr->flags & UNIT_DIS) /* disabled? */
+@@ -1377,7 +1377,7 @@ if (dptr->modifiers == NULL)
+
+ while (*cptr != 0) { /* do all mods */
+ cptr = get_glyph (cptr, gbuf, ','); /* get modifier */
+- if (cvptr = strchr (gbuf, '=')) /* = value? */
++ if ((cvptr = strchr (gbuf, '='))) /* = value? */
+ *cvptr++ = 0;
+ for (mptr = dptr->modifiers; mptr->mask != 0; mptr++) {
+ if (((mptr->mask & MTAB_XTD)? /* right level? */
+@@ -1396,7 +1396,7 @@ while (*cptr != 0) {
+ } /* end if */
+ } /* end for */
+ if (mptr->mask == 0) { /* no match? */
+- if (shptr = find_shtab (shtb, gbuf)) /* global match? */
++ if ((shptr = find_shtab (shtb, gbuf))) /* global match? */
+ shptr->action (ofile, dptr, uptr, shptr->arg, cptr);
+ else return SCPE_ARG;
+ } /* end if */
+@@ -1800,7 +1800,7 @@ if (sim_brk_types == 0)
+ return SCPE_NOFNC;
+ if ((dptr == NULL) || (uptr == NULL))
+ return SCPE_IERR;
+-if (aptr = strchr (cptr, ';')) { /* ;action? */
++if ((aptr = strchr (cptr, ';'))) { /* ;action? */
+ if (flg != SSH_ST) /* only on SET */
+ return SCPE_ARG;
+ *aptr++ = 0; /* separate strings */
+@@ -3699,7 +3699,7 @@ if ((cptr == NULL) || (*cptr == 0))
+ return SCPE_ARG;
+ strncpy (gbuf, cptr, CBUFSIZE);
+ addrp = gbuf; /* default addr */
+-if (portp = strchr (gbuf, ':')) /* x:y? split */
++if ((portp = strchr (gbuf, ':'))) /* x:y? split */
+ *portp++ = 0;
+ else if (strchr (gbuf, '.')) /* x.y...? */
+ portp = NULL;
+@@ -3782,7 +3782,7 @@ DEVICE *dptr;
+
+ if (uptr == NULL) /* arg error? */
+ return NULL;
+-if (dptr = find_dev (cptr)) { /* exact match? */
++if ((dptr = find_dev (cptr))) { /* exact match? */
+ if (qdisable (dptr)) /* disabled? */
+ return NULL;
+ *uptr = dptr->units; /* unit 0 */
+@@ -3862,7 +3862,7 @@ REG *rptr, *srptr = NULL;
+ for (i = 0; (dptr = sim_devices[i]) != 0; i++) { /* all dev */
+ if (dptr->flags & DEV_DIS) /* skip disabled */
+ continue;
+- if (rptr = find_reg (cptr, optr, dptr)) { /* found? */
++ if ((rptr = find_reg (cptr, optr, dptr))) { /* found? */
+ if (srptr) /* ambig? err */
+ return NULL;
+ srptr = rptr; /* save reg */
+@@ -4080,15 +4080,15 @@ const char logstr[] = "|&^", cmpstr[] =
+ logval = cmpval = 0;
+ if (*cptr == 0) /* check for clause */
+ return NULL;
+-for (logop = cmpop = -1; c = *cptr++; ) { /* loop thru clauses */
+- if (sptr = strchr (logstr, c)) { /* check for mask */
++for (logop = cmpop = -1; (c = *cptr++); ) { /* loop thru clauses */
++ if ((sptr = strchr (logstr, c))) { /* check for mask */
+ logop = (int32)(sptr - logstr);
+ logval = strtotv (cptr, &tptr, radix);
+ if (cptr == tptr)
+ return NULL;
+ cptr = tptr;
+ }
+- else if (sptr = strchr (cmpstr, c)) { /* check for boolop */
++ else if ((sptr = strchr (cmpstr, c))) { /* check for boolop */
+ cmpop = (int32)(sptr - cmpstr);
+ if (*cptr == '=') {
+ cmpop = cmpop + strlen (cmpstr);
+@@ -4753,7 +4753,7 @@ while (isspace (*sim_brk_act))
+ sim_brk_act++;
+ if (*sim_brk_act == 0) /* now empty? */
+ return (sim_brk_act = NULL);
+-if (ep = strchr (sim_brk_act, ';')) { /* cmd delimiter? */
++if ((ep = strchr (sim_brk_act, ';'))) { /* cmd delimiter? */
+ lnt = ep - sim_brk_act; /* cmd length */
+ memcpy (buf, sim_brk_act, lnt + 1); /* copy with ; */
+ buf[lnt] = 0; /* erase ; */
diff --git a/emulators/simh/files/patch-sim__console.c b/emulators/simh/files/patch-sim__console.c
new file mode 100644
index 000000000000..6ebaafa1caff
--- /dev/null
+++ b/emulators/simh/files/patch-sim__console.c
@@ -0,0 +1,33 @@
+--- sim_console.c.orig 2016-12-01 22:43:43 UTC
++++ sim_console.c
+@@ -162,10 +162,10 @@ if ((cptr == NULL) || (*cptr == 0))
+ return SCPE_2FARG;
+ while (*cptr != 0) { /* do all mods */
+ cptr = get_glyph_nc (cptr, gbuf, ','); /* get modifier */
+- if (cvptr = strchr (gbuf, '=')) /* = value? */
++ if ((cvptr = strchr (gbuf, '='))) /* = value? */
+ *cvptr++ = 0;
+ get_glyph (gbuf, gbuf, 0); /* modifier to UC */
+- if (ctptr = find_ctab (set_con_tab, gbuf)) { /* match? */
++ if ((ctptr = find_ctab (set_con_tab, gbuf))) { /* match? */
+ r = ctptr->action (ctptr->arg, cvptr); /* do the rest */
+ if (r != SCPE_OK)
+ return r;
+@@ -190,7 +190,7 @@ if (*cptr == 0) {
+ }
+ while (*cptr != 0) {
+ cptr = get_glyph (cptr, gbuf, ','); /* get modifier */
+- if (shptr = find_shtab (show_con_tab, gbuf))
++ if ((shptr = find_shtab (show_con_tab, gbuf)))
+ shptr->action (st, dptr, uptr, shptr->arg, cptr);
+ else return SCPE_NOPARAM;
+ }
+@@ -459,7 +459,7 @@ if ((c == SCPE_STOP) || (sim_con_tmxr.ma
+ if (sim_con_ldsc.conn == 0) /* no Telnet conn? */
+ return SCPE_LOST;
+ tmxr_poll_rx (&sim_con_tmxr); /* poll for input */
+-if (c = tmxr_getc_ln (&sim_con_ldsc)) /* any char? */
++if ((c = tmxr_getc_ln (&sim_con_ldsc))) /* any char? */
+ return (c & (SCPE_BREAK | 0377)) | SCPE_KFLAG;
+ return SCPE_OK;
+ }
diff --git a/emulators/simh/files/patch-sim__ether.c b/emulators/simh/files/patch-sim__ether.c
new file mode 100644
index 000000000000..7d5157ab36bd
--- /dev/null
+++ b/emulators/simh/files/patch-sim__ether.c
@@ -0,0 +1,43 @@
+--- sim_ether.c.orig 2016-12-01 22:43:43 UTC
++++ sim_ether.c
+@@ -1333,7 +1333,7 @@ static void eth_get_nic_hw_addr(ETH_DEV*
+ for (i=0; patterns[i] && (0 == dev->have_host_nic_phy_addr); ++i) {
+ snprintf(command, sizeof(command)-1, "ifconfig %s | %s >NIC.hwaddr", devname, patterns[i]);
+ system(command);
+- if (f = fopen("NIC.hwaddr", "r")) {
++ if ((f = fopen("NIC.hwaddr", "r"))) {
+ while (0 == dev->have_host_nic_phy_addr) {
+ if (fgets(command, sizeof(command)-1, f)) {
+ char *p1, *p2;
+@@ -1519,7 +1519,7 @@ sim_debug(dev->dbit, dev->dptr, "Writer
+ pthread_mutex_lock (&dev->writer_lock);
+ while (dev->handle) {
+ pthread_cond_wait (&dev->writer_cond, &dev->writer_lock);
+- while (request = dev->write_requests) {
++ while ((request = dev->write_requests)) {
+ /* Pull buffer off request list */
+ dev->write_requests = request->next;
+ pthread_mutex_unlock (&dev->writer_lock);
+@@ -1827,11 +1827,11 @@ pthread_mutex_destroy (&dev->writer_lock
+ pthread_cond_destroy (&dev->writer_cond);
+ if (1) {
+ struct write_request *buffer;
+- while (buffer = dev->write_buffers) {
++ while ((buffer = dev->write_buffers)) {
+ dev->write_buffers = buffer->next;
+ free(buffer);
+ }
+- while (buffer = dev->write_requests) {
++ while ((buffer = dev->write_requests)) {
+ dev->write_requests = buffer->next;
+ free(buffer);
+ }
+@@ -2084,7 +2084,7 @@ if (!dev) return SCPE_UNATT;
+
+ /* Get a buffer */
+ pthread_mutex_lock (&dev->writer_lock);
+-if (request = dev->write_buffers)
++if ((request = dev->write_buffers))
+ dev->write_buffers = request->next;
+ pthread_mutex_unlock (&dev->writer_lock);
+ if (!request)
diff --git a/emulators/simh/files/patch-sim__tape.c b/emulators/simh/files/patch-sim__tape.c
new file mode 100644
index 000000000000..93cc5df112ef
--- /dev/null
+++ b/emulators/simh/files/patch-sim__tape.c
@@ -0,0 +1,20 @@
+--- sim_tape.c.orig 2016-12-01 22:43:43 UTC
++++ sim_tape.c
+@@ -404,7 +404,7 @@ t_addr opos;
+ t_stat st;
+
+ opos = uptr->pos; /* old position */
+-if (st = sim_tape_rdlntf (uptr, &tbc)) /* read rec lnt */
++if ((st = sim_tape_rdlntf (uptr, &tbc))) /* read rec lnt */
+ return st;
+ *bc = rbc = MTR_L (tbc); /* strip error flag */
+ if (rbc > max) { /* rec out of range? */
+@@ -453,7 +453,7 @@ uint32 f = MT_GET_FMT (uptr);
+ t_mtrlnt i, rbc, tbc;
+ t_stat st;
+
+-if (st = sim_tape_rdlntr (uptr, &tbc)) /* read rec lnt */
++if ((st = sim_tape_rdlntr (uptr, &tbc))) /* read rec lnt */
+ return st;
+ *bc = rbc = MTR_L (tbc); /* strip error flag */
+ if (rbc > max) /* rec out of range? */
diff --git a/emulators/simh/files/patch-swtp6800_common_bootrom.c b/emulators/simh/files/patch-swtp6800_common_bootrom.c
new file mode 100644
index 000000000000..7e7f5d066b18
--- /dev/null
+++ b/emulators/simh/files/patch-swtp6800_common_bootrom.c
@@ -0,0 +1,11 @@
+--- swtp6800/common/bootrom.c.orig 2016-12-01 22:43:43 UTC
++++ swtp6800/common/bootrom.c
+@@ -144,7 +144,7 @@ t_stat BOOTROM_config (UNIT *uptr, int32
+ if (val == UNIT_NONE)
+ BOOTROM_unit.capac = 0; /* set EPROM size */
+ else
+- BOOTROM_unit.capac = 0x200 << (val >> UNIT_V_MSIZE) - 1; /* set EPROM size */
++ BOOTROM_unit.capac = 0x200 << ((val >> UNIT_V_MSIZE) - 1); /* set EPROM size */
+ if (BOOTROM_unit.filebuf) { /* free buffer */
+ free (BOOTROM_unit.filebuf);
+ BOOTROM_unit.filebuf = NULL;
diff --git a/emulators/simh/files/patch-swtp6800_common_m6800.c b/emulators/simh/files/patch-swtp6800_common_m6800.c
new file mode 100644
index 000000000000..a88ffb00ec48
--- /dev/null
+++ b/emulators/simh/files/patch-swtp6800_common_m6800.c
@@ -0,0 +1,37 @@
+--- swtp6800/common/m6800.c.orig 2016-12-01 22:43:43 UTC
++++ swtp6800/common/m6800.c
+@@ -316,7 +316,7 @@ int32 sim_instr (void)
+ while (reason == 0) { /* loop until halted */
+ // dump_regs1();
+ if (sim_interval <= 0) /* check clock queue */
+- if (reason = sim_process_event ())
++ if ((reason = sim_process_event ()))
+ break;
+ if (mem_fault) { /* memory fault? */
+ mem_fault = 0; /* reset fault flag */
+@@ -1890,18 +1890,20 @@ int32 get_flag(int32 flg)
+
+ void condevalVa(int32 op1, int32 op2)
+ {
+- if (get_flag(CF))
++ if (get_flag(CF)) {
+ COND_SET_FLAG_V(((op1 & 0x80) && (op2 & 0x80)) || (
+- (op1 & 0x80 == 0) && (op2 & 0x80 == 0)));
++ ((op1 & 0x80) == 0) && ((op2 & 0x80) == 0)));
++ }
+ }
+
+ /* test and set V for subtraction */
+
+ void condevalVs(int32 op1, int32 op2)
+ {
+- if (get_flag(CF))
+- COND_SET_FLAG_V(((op1 & 0x80) && (op2 & 0x80 == 0)) ||
+- ((op1 & 0x80 == 0) && (op2 & 0x80)));
++ if (get_flag(CF)) {
++ COND_SET_FLAG_V(((op1 & 0x80) && ((op2 & 0x80) == 0)) ||
++ ((((op1 & 0x80) == 0)) && (op2 & 0x80)));
++ }
+ }
+
+ /* calls from the simulator */