1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-22 12:33:29 +00:00

Provide a route to operation that factors in addressing mode.

This commit is contained in:
Thomas Harte 2022-09-06 11:26:16 -04:00
parent 1a7509e860
commit 72b6ab4389
2 changed files with 10 additions and 0 deletions

View File

@ -269,3 +269,7 @@ std::string Preinstruction::to_string(int opcode) const {
return result;
}
const char *Preinstruction::operation_string() const {
return _to_string(operation, mode<0>() == AddressingMode::Quick);
}

View File

@ -348,6 +348,12 @@ class Preinstruction {
/// is supplied then any quick fields in this instruction will be decoded;
/// otherwise they'll be printed as just 'Q'.
std::string to_string(int opcode = -1) const;
/// Produces a slightly-more-idiomatic version of the operation name than
/// a direct to_string(instruction.operation) would, given that this decoder
/// sometimes aliases operations, disambiguating based on addressing mode
/// (e.g. MOVEQ is MOVE.l with the Q addressing mode).
const char *operation_string() const;
};
}