summaryrefslogtreecommitdiff
path: root/emulators/simh/files/patch-swtp6800_common_m6800.c
blob: a88ffb00ec48c968182becb2549e8551c31fafda (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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 */