Implement thumb POP instruction

This commit is contained in:
MerryMage 2016-07-18 17:37:48 +01:00
parent f7e3d7b8d2
commit dfef65d98f
6 changed files with 45 additions and 6 deletions

View file

@ -298,6 +298,24 @@ public:
return ret;
}
std::string thumb16_POP(bool P, RegList reg_list) {
if (P)
reg_list |= 1 << 15;
std::string ret = "PUSH ";
bool first_reg = true;
for (size_t i = 0; i < 16; i++) {
if (Common::Bit(i, reg_list)) {
if (!first_reg)
ret += ", ";
ret += RegStr(static_cast<Reg>(i));
first_reg = false;
}
}
return ret;
}
std::string thumb16_REV(Reg m, Reg d) {
return Common::StringFromFormat("rev %s, %s", RegStr(d), RegStr(m));
}