From 6561b6287f2825a334a8f5fe9a4d5ffdc45fb15a Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 6 Dec 1993 10:14:43 +0000 Subject: [PATCH] Fix: CMP instruction with small constant does not handle PC-relative --- mach/m68k2/as/mach5.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/mach/m68k2/as/mach5.c b/mach/m68k2/as/mach5.c index dbe0e6c35..646fe1542 100644 --- a/mach/m68k2/as/mach5.c +++ b/mach/m68k2/as/mach5.c @@ -221,6 +221,25 @@ cmp(sz) return; } if (mrg_1 == 074 && (mrg_2 & 070) != 010) { + if (mrg_2 == 072) { + /* In this case, the ea707172 routine changed the + addressing mode to PC-relative. However, this is + not allowed for this instruction. Change it back + to absolute, but also correct for the optimization + that the ea707172 routine thought it made. + */ + if (pass == PASS_1) { + /* In this case, the user wrote it PC-relative. + Error. + */ + badoperand(); + } + mrg_2 = 071; + exp_2.val += DOTVAL+2; + if (pass == PASS_2) { + DOTGAIN -= 2; + } + } emit2(06000 | sz | mrg_2); ea_1(sz, 0); ea_2(sz, DTA|ALT); -- 2.34.1