1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-04-21 18:37:11 +00:00

Merge pull request #1489 from TomHarte/MinorExtraStrings

Slightly improve x86 instruction to string lexicon.
This commit is contained in:
Thomas Harte 2025-03-12 21:34:18 -04:00 committed by GitHub
commit 9b9cdfe937
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 0 deletions

View File

@ -30,6 +30,15 @@ enum class AccessType {
PreauthorisedRead,
};
constexpr const char *to_string(const AccessType type) {
switch(type) {
case AccessType::Read: return "read";
case AccessType::Write: return "write";
case AccessType::ReadModifyWrite: return "read-modify-write";
case AccessType::PreauthorisedRead: return "preauthorised read";
}
}
constexpr bool is_writeable(const AccessType type) {
return type == AccessType::ReadModifyWrite || type == AccessType::Write;
}

View File

@ -120,6 +120,7 @@ std::string InstructionSet::x86::to_string(Operation operation, DataSize size, M
case Operation::IN: return "in";
case Operation::OUT: return "out";
case Operation::OUTS: return "outs";
case Operation::JO: return "jo";
case Operation::JNO: return "jno";
@ -223,6 +224,7 @@ std::string InstructionSet::x86::to_string(Operation operation, DataSize size, M
case Operation::NOP: return "nop";
case Operation::POP: return "pop";
case Operation::POPF: return "popf";
case Operation::PUSHA: return "pusha";
case Operation::PUSH: return "push";
case Operation::PUSHF: return "pushf";
case Operation::RCL: return "rcl";