From cadc95fb537cf4a3a1fa3be0e108ee52c5cef84d Mon Sep 17 00:00:00 2001 From: ggn Date: Sat, 18 Jul 2020 19:34:16 +0300 Subject: [PATCH] Fix a bug in +o5 where outer displacement would not optimise to word size --- parmode.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/parmode.h b/parmode.h index 7e31545..44e08d9 100644 --- a/parmode.h +++ b/parmode.h @@ -616,13 +616,15 @@ CHECKODn: if (*tok == DOTL) tok++; // Doesn't matter, we're going for .L anyway + WORD od_ea = 0; + // 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 - 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; @@ -644,11 +646,12 @@ CHECKODn: && ((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; 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 -- 2.37.2