From 31cf2fd547a3eadf5ca4c4f903ccd00f0126eb71 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 31 May 2020 19:40:24 +0300 Subject: [PATCH] Fix assembler not supporting instructions that modify address register but mnemonic not ending to 'A'. --- disasm.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/disasm.cpp b/disasm.cpp index b741e555..4b99b17d 100644 --- a/disasm.cpp +++ b/disasm.cpp @@ -1265,6 +1265,7 @@ int m68k_asm(TCHAR *sline, uae_u16 *out, uaecptr pc) uae_u32 dval = 0; int ssize = -1; int dsize = -1; + struct mnemolookup *lookup; dmode = asm_parse_mode(dstea, &dreg, &dval, &dextcnt, dexts); @@ -1319,7 +1320,15 @@ int m68k_asm(TCHAR *sline, uae_u16 *out, uaecptr pc) ins[l + 1] = 0; } } else if (last != 'A') { - _tcscat(ins, _T("A")); + TCHAR insa[256]; + _tcscpy(insa, ins); + _tcscat(insa, _T("A")); + for (lookup = lookuptab; lookup->name; lookup++) { + if (!_tcscmp(insa, lookup->name)) { + _tcscpy(ins, insa); + break; + } + } } } @@ -1333,7 +1342,6 @@ int m68k_asm(TCHAR *sline, uae_u16 *out, uaecptr pc) tsize = 2; } - struct mnemolookup *lookup; for (lookup = lookuptab; lookup->name; lookup++) { if (!_tcscmp(ins, lookup->name)) break; -- 2.47.3