diff options
Diffstat (limited to 'intel.cpp')
-rw-r--r-- | intel.cpp | 29 |
1 files changed, 0 insertions, 29 deletions
@@ -22,21 +22,6 @@ using namespace std::placeholders; namespace { - // REX prefix: 0b0100WRXB - std::vector<uint8_t> REX(std::string s) { - uint8_t result{0b01000000}; - if (s == "W") - result |= 0b00001000; - if (s == "R") - result |= 0b00000100; - if (s == "X") - result |= 0b00000010; - if (s == "B") - result |= 0b00000001; - - return { result }; - } - std::vector<uint8_t> imm8(std::string s) { long value{ std::stol(s) }; uint8_t* bin = reinterpret_cast<uint8_t*>(&value); @@ -138,20 +123,6 @@ namespace { std::unordered_map<std::string, std::function<InstructionCodeList(const std::vector<Token>&)>> ops_old{ - // Integer Addition - {"add", [](const std::vector<Token>& sl) -> InstructionCodeList { - if (sl.size() == 3) { - if (sl[1].value == "eax") { // ADD EAX, imm32 - return { { std::vector<uint8_t>{ 0x05 } +imm32(sl[2].value), {} } }; - } else if (sl[1].value == "rax") { // ADD RAX, imm32 - return { { REX("W") + std::vector<uint8_t>{ 0x05 } +imm32(sl[2].value), {} } }; - } - } - - // ... TODO - throw std::runtime_error("Unknown command: "s + sl[0].value); - }}, - // Call Procedure {"call", std::bind(op_jmp, _1, OP_T{}, OP_T{ 0xE8 })}, |