summaryrefslogtreecommitdiffhomepage
path: root/asm/intel64/trivials.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-11-18 17:55:27 +0100
committerRoland Reichwein <mail@reichwein.it>2020-11-18 17:55:27 +0100
commit031bfef600e7021c8bd72e2e663f368e7386b131 (patch)
tree4e724c3b13278e5c6fb90a9380d19dc1d253b4b3 /asm/intel64/trivials.cpp
parent927eb99e75325164a541c2638e1e607294019381 (diff)
Added Asm ops
Diffstat (limited to 'asm/intel64/trivials.cpp')
-rw-r--r--asm/intel64/trivials.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/asm/intel64/trivials.cpp b/asm/intel64/trivials.cpp
index eb1bbb8..ef537b6 100644
--- a/asm/intel64/trivials.cpp
+++ b/asm/intel64/trivials.cpp
@@ -2,13 +2,18 @@
#include <asm/assembler.h>
-Op_nop::Op_nop(): OpSimple({ 0x90 }) {}
+Op_lahf::Op_lahf(): OpSimple({ 0x9F }) {} // Load flags to AH
+Op_nop::Op_nop(): OpSimple({ 0x90 }) {} // No operation
Op_ret::Op_ret(): OpSimple({ 0xC3 }) {} // near return; TODO: far return is 0xCB
-Op_syscall::Op_syscall(): OpSimple({ 0x0F, 0x05 }) {}
+Op_syscall::Op_syscall(): OpSimple({ 0x0F, 0x05 }) {} // Syscall
+Op_ud2::Op_ud2(): OpSimple({ 0x0F, 0x0B }) {} // Undefined Instruction, variant 2: with no operands
namespace {
bool registered {
+ registerOp("lahf", [](const Asm::Args& args) -> std::shared_ptr<Op>{
+ return std::make_shared<Op_lahf>();
+ }) &&
registerOp("nop", [](const Asm::Args& args) -> std::shared_ptr<Op>{
return std::make_shared<Op_nop>();
}) &&
@@ -17,6 +22,9 @@ bool registered {
}) &&
registerOp("syscall", [](const Asm::Args& args) -> std::shared_ptr<Op>{
return std::make_shared<Op_syscall>();
+ }) &&
+ registerOp("ud2", [](const Asm::Args& args) -> std::shared_ptr<Op>{
+ return std::make_shared<Op_ud2>();
})
};