implemented NEG
This commit is contained in:
1 parent
363b198a03
commit
beedad3377
4 files changed
+42
-9
No files matched your search
@@ -210,6 +210,26 @@ std::string generateInOrXorTable(void)
|
||||
return outStr.str() + "}\n\n\n";
|
||||
}
|
||||
|
||||
std::string generateNegTable(void)
|
||||
{
|
||||
std::stringstream outStr;
|
||||
outStr << "!macro PUT_Z80_FTABLE_NEG {\n";
|
||||
|
||||
for (uint16_t idx = 0; idx < 0x100; idx++)
|
||||
{
|
||||
uint8_t flags = Z80_NF;
|
||||
if (0 - idx >= 0x80) flags |= Z80_SF;
|
||||
if (idx == 0) flags |= Z80_ZF;
|
||||
if (idx != 0) flags |= Z80_HF | Z80_CF;
|
||||
if (idx == 0x80) flags |= Z80_VF;
|
||||
if ((0 - idx) & 0x08) flags |= Z80_XF;
|
||||
if ((0 - idx) & 0x20) flags |= Z80_YF;
|
||||
|
||||
outStr << "\t!byte $" << std::hex << std::setw(2) << std::setfill('0') << int(flags) << "\n";
|
||||
}
|
||||
|
||||
return outStr.str() + "}\n\n\n";
|
||||
}
|
||||
|
||||
|
||||
typedef struct FlagsDAA
|
||||
@@ -333,6 +353,7 @@ void writeTables()
|
||||
outFile << generateDecTable();
|
||||
outFile << generateAndTable();
|
||||
outFile << generateInOrXorTable();
|
||||
outFile << generateNegTable();
|
||||
outFile << generateDaaTables();
|
||||
|
||||
// XXX
|
||||
|
||||
Reference in new issue
Block a user