Version bump for last commit; now at v2.0.23.
[rmac] / parmode.h
index 7e31545b16f36955b8a7e114910269870f14be08..dd3e1a2b03ee87b6bd58b0a6df3da462ab7bfe2f 100644 (file)
--- a/parmode.h
+++ b/parmode.h
@@ -367,8 +367,8 @@ AMn_IXN:                 // Handle any indexed (tok -> a comma)
                                        tok++;
                        }
 
                                        tok++;
                        }
 
-                       // Check for address register or PC, 
-                       // suppress base register otherwise
+                       // Check for address register or PC, suppress base register
+                       // otherwise
 
                        if (*tok == KW_PC)
                        {                                       // ([bd,PC,...
 
                        if (*tok == KW_PC)
                        {                                       // ([bd,PC,...
@@ -571,7 +571,7 @@ AMn_IXN:                 // Handle any indexed (tok -> a comma)
                                        default:
                                                goto badmode;
                                        }
                                        default:
                                                goto badmode;
                                        }
-                                       
+
                                }
 
                                // Check for od
                                }
 
                                // Check for od
@@ -616,13 +616,15 @@ CHECKODn:
                                        if (*tok == DOTL)
                                                tok++;                          // Doesn't matter, we're going for .L anyway
 
                                        if (*tok == DOTL)
                                                tok++;                          // Doesn't matter, we're going for .L anyway
 
+                                       WORD od_ea = 0;
+
                                        // od.L
                                        if (!(AnEXTEN & EXT_BS))
                                        // od.L
                                        if (!(AnEXTEN & EXT_BS))
-                                               AnEXTEN |= EXT_IISPOSL; // Long outer displacement
+                                               od_ea = EXT_IISPOSL; // Long outer displacement
                                        else
                                        {
                                                // bd is suppressed, so sticking the od size in bd
                                        else
                                        {
                                                // bd is suppressed, so sticking the od size in bd
-                                               AnEXTEN |= EXT_BDSIZEL;
+                                               od_ea = EXT_BDSIZEL;
                                                // And of course the expression has to be copied to
                                                // AnBEXPR instead of AnEXPR. Yay. :-/
                                                int i = 0;
                                                // And of course the expression has to be copied to
                                                // AnBEXPR instead of AnEXPR. Yay. :-/
                                                int i = 0;
@@ -631,7 +633,8 @@ CHECKODn:
                                                {
                                                        AnBEXPR[i] = AnEXPR[i];
                                                        i++;
                                                {
                                                        AnBEXPR[i] = AnEXPR[i];
                                                        i++;
-                                               } while (AnEXPR[i] != 'E');
+                                               }
+                                               while (AnEXPR[i] != 'E');
 
                                                AnBEXPR[i] = 'E';
                                        }
 
                                                AnBEXPR[i] = 'E';
                                        }
@@ -644,11 +647,13 @@ CHECKODn:
                                                && ((AnEXATTR & (TDB | DEFINED)) == DEFINED)
                                                && (((uint32_t)AnEXVAL + 0x8000) < 0x10000))
                                        {
                                                && ((AnEXATTR & (TDB | DEFINED)) == DEFINED)
                                                && (((uint32_t)AnEXVAL + 0x8000) < 0x10000))
                                        {
-                                               AnEXTEN |= EXT_IISPOSW; // Word outer displacement
+                                               od_ea = EXT_IISPOSW; // Word outer displacement
                                                AMn = MEMPOST + ea_PC;
                                                AMn = MEMPOST + ea_PC;
+
                                                if (optim_warn_flag)
                                                        warn("absolute value in outer displacement ranging $FFFF8000..$00007FFF optimised to absolute short");
                                        }
                                                if (optim_warn_flag)
                                                        warn("absolute value in outer displacement ranging $FFFF8000..$00007FFF optimised to absolute short");
                                        }
+                                       AnEXTEN |= od_ea;
                                }
 
                                // Check for final closing parenthesis
                                }
 
                                // Check for final closing parenthesis