From 1fae63de23320a1663b7c591e247ad81852ab6dc Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sun, 22 Nov 2020 13:00:06 +0100 Subject: Support 16-bit short --- asm/intel64/mov.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'asm/intel64/mov.cpp') diff --git a/asm/intel64/mov.cpp b/asm/intel64/mov.cpp index 805675a..9382a76 100644 --- a/asm/intel64/mov.cpp +++ b/asm/intel64/mov.cpp @@ -16,6 +16,11 @@ Op_mov::Op_mov(const Asm::Args& args) machine_code = std::vector{ 0x88 } + ModRM(std::any_cast(args[1]).name(), std::any_cast(args[0]).name()); + } else if (args[0].type() == typeid(Asm::Args::Register16) && args[1].type() == typeid(Asm::Args::Register16)) { // mov reg16, reg16 + // r/m16, r16: ModRM:r/m (w), ModRM:reg (r) + machine_code = OpSizePrefix() + std::vector{ 0x89 } + + ModRM(std::any_cast(args[1]).name(), std::any_cast(args[0]).name()); + } else if (args[0].type() == typeid(Asm::Args::Register32) && args[1].type() == typeid(Asm::Args::Register32)) { // mov reg32, reg32 // r/m32, r32: ModRM:r/m (w), ModRM:reg (r) machine_code = std::vector{ 0x89 } + @@ -79,6 +84,9 @@ bool registered { registerOp(mangleName("mov"), [](const Asm::Args& args) -> std::shared_ptr{ return std::make_shared(args); }) && + registerOp(mangleName("mov"), [](const Asm::Args& args) -> std::shared_ptr{ + return std::make_shared(args); + }) && registerOp(mangleName("mov"), [](const Asm::Args& args) -> std::shared_ptr{ return std::make_shared(args); }) && -- cgit v1.2.3