From de72c35dc921081a2f90ba1b4fa51a6db8387240 Mon Sep 17 00:00:00 2001 From: Hermann Seib Date: Mon, 17 Oct 2022 20:11:53 +0200 Subject: [PATCH] 68HC11 fix hc11 didn't work after last change; corrected. Inverted boppcom default since A09 can now handle it properly. --- Dasm68HC11.cpp | 4 ++-- Dasm68HC11.h | 2 +- DasmAvr8.cpp | 1 - dasmfw.cpp | 14 ++++++++++---- dasmfw.h | 4 ++-- history.txt | 4 +++- 6 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Dasm68HC11.cpp b/Dasm68HC11.cpp index 4cd5ad3..0ea58d5 100644 --- a/Dasm68HC11.cpp +++ b/Dasm68HC11.cpp @@ -385,12 +385,12 @@ codes = m68hc11_codes; codes18 = m68hc11_codes18; codes1a = m68hc11_codes1a; codescd = m68hc11_codescd; -boppcom = false; // A09 can't handle commas as bitop parameter delimiter yet +boppcom = true; // since V1.58, A09 can handle commas as bitop parameter delimiter int i; mnemo.resize(mnemo68HC11_count); /* set up additional mnemonics */ for (i = 0; i < mnemo68HC11_count - mnemo6801_count; i++) mnemo[mnemo6801_count + i] = opcodes[i]; -regname.resize(reg6801_count); /* set up additional register names */ +regname.resize(reg68HC11_count); /* set up additional register names */ for (i = 0; i < reg68HC11_count - reg6801_count; i++) regname[reg6801_count + i] = regnames[i]; // set up options table diff --git a/Dasm68HC11.h b/Dasm68HC11.h index 4a306a8..117f8b9 100644 --- a/Dasm68HC11.h +++ b/Dasm68HC11.h @@ -87,7 +87,7 @@ class Dasm68HC11 : public Dasm6801 mnemo68HC11_count }; - enum Reg6801 + enum Reg68HC11 { _y = reg6801_count, diff --git a/DasmAvr8.cpp b/DasmAvr8.cpp index dc8a6a0..348d27d 100644 --- a/DasmAvr8.cpp +++ b/DasmAvr8.cpp @@ -744,7 +744,6 @@ if (!( (c >= '0' && c <= '9') || bool done = false; int nBytes = 0; -adr_t fbegin = GetHighestBusAddr(bus); adr_t fend = GetLowestBusAddr(bus); MemoryType memType = GetDefaultMemoryType(bus); diff --git a/dasmfw.cpp b/dasmfw.cpp index 3f4a753..762eb44 100644 --- a/dasmfw.cpp +++ b/dasmfw.cpp @@ -919,8 +919,7 @@ bool Application::PostprocessLine string &sLabel, string &smnemo, string &sparm, - string &scomment, - int &labelLen + string &scomment ) { size_t pos = smnemo.find("$("); @@ -956,13 +955,15 @@ while (pos != string::npos) /* mnemo containing $( is special, */ smnemo = smnemo.substr(0, pos) + smnemo.substr(pos + endpos); sLabel = smnemo; smnemo = sparm; - sparm = ""; + sparm = ""; // might be a bad bad bad idea to shift comment left pos = (size_t)-1; } } pos = smnemo.find("$(", pos + 1); } +(void)scomment; /* not used yet - keep gcc happy */ + return true; } @@ -983,7 +984,7 @@ if (labelLen < 0) labelLen = this->labelLen; int nLen = 0; int nMinLen = labelLen; -PostprocessLine(sLabel, smnemo, sparm, scomment, labelLen); +PostprocessLine(sLabel, smnemo, sparm, scomment); if (sLabel.size()) { nLen += fprintf(out, "%s", sLabel.c_str()); @@ -1965,6 +1966,11 @@ do case infoReg : pDasm->RegRename(org, value); break; + default : + // g++ (7.5.0) -Wall complains about lots of missing command types + // unless this default part is added, blindly ignoring the fact + // that it is impossible to get to this inner switch for them. + break; } } break; diff --git a/dasmfw.h b/dasmfw.h index 81f7fec..62b42c5 100644 --- a/dasmfw.h +++ b/dasmfw.h @@ -59,7 +59,7 @@ using namespace std; /* Global definitions */ /*****************************************************************************/ -#define DASMFW_VERSION "0.34" +#define DASMFW_VERSION "0.35" // set these to int64_t once 64bit processors become part of the framework typedef uint32_t cadr_t; /* container for maximal code address*/ @@ -229,7 +229,7 @@ class Application adr_t DisassembleLine(adr_t addr, string sComDel, string sComHdr, string labelDelim, int bus = BusCode); bool PrintLine(string sLabel = "", string smnemo = "", string sparm = "", string scomment = "", int labelLen = -1); bool PrintLabelEqu(Label *pLabel, string sLabel = ""); - bool PostprocessLine(string &sLabel, string &smnemo, string &sparm, string &scomment, int &labelLen); + bool PostprocessLine(string &sLabel, string &smnemo, string &sparm, string &scomment); bool LoadInfo(string fileName, vector &loadStack, bool bProcInfo = true, bool bSetDasm = false); int ParseInfoRange(string value, adr_t &from, adr_t &to, adr_t &step, bool remapped = true); int ParseOption diff --git a/history.txt b/history.txt index c1a6962..8f77e34 100644 --- a/history.txt +++ b/history.txt @@ -88,4 +88,6 @@ v0.31 2022-06-08 Added mnemo info file directive Added boppcom option for 68HC11 v0.32 2022-10-10 begin and end options didn't work as intended; they should now. v0.33 2022-10-11 Added some features to the mnemo directive -v0.34 2022-10-13 reg directive added \ No newline at end of file +v0.34 2022-10-13 reg directive added +v0.35 2022-10-17 Little fix for 68HC11 (deadly little error...) + Inverted boppcom default since A09 can now handle it properly