hack 68000-compatible replacement for RTD instruction into asfilter

This commit is contained in:
Wolfgang Thaller 2014-09-24 22:05:01 +02:00
parent 3f1eec11f9
commit dc386a4845

View File

@ -71,6 +71,7 @@ int main(int argc, char *argv[])
rx::regex rts("\trts");
rx::regex instruction("\t[a-z]+.*");
rx::regex macsbug("# macsbug symbol");
rx::regex rtd("\trtd #([0-9]+)");
bool hadRts = false;
bool macsbugSymbol = false, macsbugSymbol1;
@ -105,6 +106,14 @@ int main(int argc, char *argv[])
}
}
else if(rx::regex_match(line, match, rtd))
{
out << "\tmove.l (%a7)+, %a0\n";
out << "\tlea " + match[1] + "(%a7), %a7\n";
out << "\tjmp (%a0)\n";
hadRts = true;
}
// ******* 2. strip unneeded extra rts from "# macsbug symbol" paragraphs
//
// GCC is patche to add something like this to the end of every function: