refine the logic so it still writes the raw bytes

This commit is contained in:
warmCabin 2021-06-25 01:24:14 -04:00
parent 6527ab4de8
commit ff41cbc330
1 changed files with 11 additions and 5 deletions

View File

@ -682,19 +682,20 @@ void Dump(FILE *fout, unsigned int startAddr, unsigned int endAddr)
}
break;
}
Name* node;
for (int j = 0; j < size; j++)
{
// Write the raw bytes of this instruction
swprintf(chr, L"%02X ", opcode[j] = GetMem(addr++));
Name* node;
// wcscat(debug_wstr, chr);
fprintf(fout, "%ls", chr);
if (j != size - 1 && (node = findNode(getNamesPointerForAddress(addr), addr)))
{
// We were treating this as an operand, but it's named!
printf("$%04X - We were treating this as an operand, but it's named %s!\n", addr, node->name);
fprintf(fout, "XXXX\n");
goto continueAddrLoop; // I don't care! YOU refactor it!
size = j + 1;
break;
}
// wcscat(debug_wstr, chr);
fprintf(fout, "%ls", chr);
}
while (size < 3)
{
@ -702,6 +703,11 @@ void Dump(FILE *fout, unsigned int startAddr, unsigned int endAddr)
fprintf(fout, "%ls", L" ");
size++;
}
if (node)
{
fprintf(fout, " INTERRUPTED\n");
goto continueAddrLoop; // I don't care! YOU refactor it!
}
static char bufferForDisassemblyWithPlentyOfStuff[64 + NL_MAX_NAME_LEN * 10]; //"plenty"
char* _a = Disassemble(addr, opcode);