about summary refs log tree commit diff
path: root/src/instructions.cpp
diff options
context:
space:
mode:
authorYour Name <you@example.com>2020-07-20 02:54:22 +0200
committerYour Name <you@example.com>2020-07-20 02:54:22 +0200
commitc69f053c29faa47d0600f5b147835e970d9cf654 (patch)
treed97af2f279114c72c3db81ffb489c316fb3f6dd6 /src/instructions.cpp
downloadAARM64-Disassembler-c69f053c29faa47d0600f5b147835e970d9cf654.tar.gz
AARM64-Disassembler-c69f053c29faa47d0600f5b147835e970d9cf654.tar.bz2
AARM64-Disassembler-c69f053c29faa47d0600f5b147835e970d9cf654.zip
Initial Commit HEAD master
Half-added some basic AARM64 instructions such as ADD, RET, MOV, NOP...
Diffstat (limited to 'src/instructions.cpp')
-rw-r--r--src/instructions.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/instructions.cpp b/src/instructions.cpp
new file mode 100644
index 0000000..f32c3e1
--- /dev/null
+++ b/src/instructions.cpp
@@ -0,0 +1,13 @@
+#include "include/instructions.hpp"
+
+Instruction::Instruction(uint8_t* hex, uint32_t offset, uint32_t pos)
+{
+    this->hex = (hex[3] << 24) | (hex[2] << 16)| (hex[1] << 8) | hex[0];
+    Utils::getbinaryrepresentation(hex, 4, this->bits);
+    this->bits[32] = '\0';
+    this->offset = offset;
+    this->pos = pos;
+    this->addr = this->offset + this->pos;
+    this->string = InstructionHanlder::getInstructionString(this);
+    this->type = InstructionHanlder::getInstruction(this);
+}