Skip to content

Commit

Permalink
68HC11 fix
Browse files Browse the repository at this point in the history
hc11 didn't work after last change; corrected.
Inverted boppcom default since A09 can now handle it properly.
  • Loading branch information
Arakula committed Oct 17, 2022
1 parent 37bd167 commit de72c35
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Dasm68HC11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Dasm68HC11.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class Dasm68HC11 : public Dasm6801

mnemo68HC11_count
};
enum Reg6801
enum Reg68HC11
{
_y = reg6801_count,

Expand Down
1 change: 0 additions & 1 deletion DasmAvr8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
14 changes: 10 additions & 4 deletions dasmfw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -919,8 +919,7 @@ bool Application::PostprocessLine
string &sLabel,
string &smnemo,
string &sparm,
string &scomment,
int &labelLen
string &scomment
)
{
size_t pos = smnemo.find("$(");
Expand Down Expand Up @@ -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;
}

Expand All @@ -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());
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions dasmfw.h
Original file line number Diff line number Diff line change
Expand Up @@ -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*/
Expand Down Expand Up @@ -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<string> &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
Expand Down
4 changes: 3 additions & 1 deletion history.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
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

0 comments on commit de72c35

Please sign in to comment.