about summary refs log tree commit diff
path: root/src/instructions.cpp
blob: f32c3e11816d80c72c6bd46979279f6dc2fba8fd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
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);
}