From da953fdf0da36c34a2e084db92a60381d8dea7c1 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 18 Sep 2023 16:25:04 -0400 Subject: [PATCH] Complete 8086 operation list; standardise enum order. --- InstructionSets/x86/Instruction.cpp | 19 ++++++++++++++----- InstructionSets/x86/Instruction.hpp | 8 ++++---- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/InstructionSets/x86/Instruction.cpp b/InstructionSets/x86/Instruction.cpp index 060ac2c22..fc6f942d0 100644 --- a/InstructionSets/x86/Instruction.cpp +++ b/InstructionSets/x86/Instruction.cpp @@ -58,11 +58,18 @@ std::string InstructionSet::x86::to_string(Operation operation, DataSize size) { case Operation::JLE: return "jle"; case Operation::JNLE: return "jnle"; - case Operation::IRET: return "iret"; - case Operation::JMPabs: return "jmp word"; - case Operation::JPCX: return "jpcx"; - case Operation::INT: return "int"; - case Operation::INTO: return "into"; + case Operation::CALLabs: return "call word"; + case Operation::CALLrel: return "call"; + case Operation::CALLfar: return "callf word"; + case Operation::IRET: return "iret"; + case Operation::RETfar: return "retf"; + case Operation::RETnear: return "retn"; + case Operation::JMPabs: return "jmp word"; + case Operation::JMPrel: return "jmp"; + case Operation::JMPfar: return "jmpf word"; + case Operation::JPCX: return "jpcx"; + case Operation::INT: return "int"; + case Operation::INTO: return "into"; case Operation::LAHF: return "lahf"; case Operation::SAHF: return "sahf"; @@ -116,6 +123,8 @@ std::string InstructionSet::x86::to_string(Operation operation, DataSize size) { case Operation::XCHG: return "xchg"; case Operation::XLAT: return "xlat"; + case Operation::Invalid: return "invalid"; + default: assert(false); } diff --git a/InstructionSets/x86/Instruction.hpp b/InstructionSets/x86/Instruction.hpp index c28893c14..d870173a3 100644 --- a/InstructionSets/x86/Instruction.hpp +++ b/InstructionSets/x86/Instruction.hpp @@ -90,12 +90,12 @@ enum class Operation: uint8_t { JO, JNO, JB, JNB, JE, JNE, JBE, JNBE, JS, JNS, JP, JNP, JL, JNL, JLE, JNLE, - /// Far call; see the segment() and offset() fields. - CALLfar, - /// Relative call; see displacement(). - CALLrel, /// Near call. CALLabs, + /// Relative call; see displacement(). + CALLrel, + /// Far call; see the segment() and offset() fields. + CALLfar, /// Return from interrupt. IRET, /// Near return; if source is not ::None then it will be an ::Immediate indicating how many additional bytes to remove from the stack.