From cc32aec131dc7fc184a6868feb55cdb2edcd109c Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Fri, 29 Mar 2019 19:40:48 +0200 Subject: [PATCH] Fix (an,dn,xxxx.w/.l) disassembly. --- newcpu.cpp | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/newcpu.cpp b/newcpu.cpp index ca354a8b..47eeacd2 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -2290,8 +2290,19 @@ static uaecptr ShowEA_disp(uaecptr *pcp, uaecptr base, TCHAR *buffer, const TCHA TCHAR *p = buffer + _tcslen(buffer); if (dp & 3) { + // indirect _stprintf(p, _T("[")); p += _tcslen(p); + } else { + // (an,dn,word/long) + if (name) { + _stprintf(p, _T("%s,"), name); + p += _tcslen(p); + } + if (dr[0]) { + _stprintf(p, _T("%s%s,"), dr, mult); + p += _tcslen(p); + } } if ((dp & 0x30) == 0x20) { // BD SIZE = 2 (WORD) @@ -2313,27 +2324,26 @@ static uaecptr ShowEA_disp(uaecptr *pcp, uaecptr base, TCHAR *buffer, const TCHA _stprintf(p, _T("%s,"), name); p += _tcslen(p); } - } - if (!(dp & 0x04)) { - if (dr[0]) { - _stprintf(p, _T("%s%s,"), dr, mult); - p += _tcslen(p); + if (!(dp & 0x04)) { + if (dr[0]) { + _stprintf(p, _T("%s%s,"), dr, mult); + p += _tcslen(p); + } } - } - if (dp & 3) { if (p[-1] == ',') p--; _stprintf(p, _T("],")); p += _tcslen(p); - } - if ((dp & 0x04)) { - if (dr[0]) { - _stprintf(p, _T("%s%s,"), dr, mult); - p += _tcslen(p); + if ((dp & 0x04)) { + if (dr[0]) { + _stprintf(p, _T("%s%s,"), dr, mult); + p += _tcslen(p); + } } + } if ((dp & 0x03) == 0x02) { -- 2.47.3