Fix move <ea>,<ea020> code generation
authorggn <ggn.dbug@gmail.com>
Sat, 18 Jul 2020 17:25:56 +0000 (20:25 +0300)
committerShamus Hammons <jlhamm@acm.org>
Mon, 3 Aug 2020 16:42:36 +0000 (11:42 -0500)
mach.c

diff --git a/mach.c b/mach.c
index 42268dcde2bd706cbb4b00f691a25338b7273a7e..27123b2cd9308a3e9f06036044a05f1387c83c05 100644 (file)
--- a/mach.c
+++ b/mach.c
@@ -796,7 +796,10 @@ int m_move(WORD inst, WORD size)
 int m_move30(WORD inst, WORD size)
 {
        int siz = (int)size;
-       inst |= siz_12[siz] | reg_9[a1reg & 7] | a0reg | extra_addressing[am0 - ABASE];
+       if (am0 > ABASE)
+               inst |= siz_12[siz] | reg_9[a1reg & 7] | a0reg | extra_addressing[am0 - ABASE];
+       else
+               inst |= siz_12[siz] | reg_9[a1reg & 7] | a0reg | extra_addressing[am1 - ABASE] << 3;
 
        D_word(inst);