X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=mach.c;h=ef4c8c6837c88cbf3c43675a96eebf4c6655ff64;hp=2673aa9f5fb5063a44fb3831bf33cf033e13084d;hb=b57de9c1d9a47f152b590f1cdbd05a2910667ce4;hpb=3b063cd8b11b5e868efec02f9e281a1e04f2707b diff --git a/mach.c b/mach.c index 2673aa9..ef4c8c6 100644 --- a/mach.c +++ b/mach.c @@ -452,6 +452,22 @@ int m_abcd(WORD inst, WORD siz) // int m_adda(WORD inst, WORD siz) { + if (a0exattr & DEFINED) + { + if (CHECK_OPTS(OPT_ADDA_ADDQ)) + if (a0exval > 1 && a0exval <= 8) + // Immediate is between 1 and 8 so let's convert to addq + return m_addq(B16(01010000, 00000000), siz); + if (CHECK_OPTS(OPT_ADDA_LEA)) + if (a0exval > 8) + { + // Immediate is larger than 8 so let's convert to lea + am0 = ADISP; // Change addressing mode + a0reg = a1reg; // In ADISP a0reg is used instead of a1reg! + return m_lea(B16(01000001, 11011000), SIZW); + } + } + inst |= am0 | a0reg | lwsiz_8[siz] | reg_9[a1reg]; D_word(inst); ea0gen(siz); // Generate EA @@ -1298,7 +1314,7 @@ int m_cas(WORD inst, WORD siz) if (*tok != EOL) return error("extra (unexpected) text found"); - // Reject invalud ea modes + // Reject invalid ea modes amsk = amsktab[am0]; if ((amsk & (M_AIND | M_APOSTINC | M_APREDEC | M_ADISP | M_AINDEXED | M_ABSW | M_ABSL | M_ABASE | M_MEMPOST | M_MEMPRE)) == 0)