Advertisement
Madmouse

a machine object

Feb 10th, 2015
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. class Intel_x86_64
  2. {
  3.     private:
  4.         std::map<std::string, std::array<unsigned, 64>> opcodes;
  5.         std::map<long unsigned, std::array<unsigned, 7>> operand_types;
  6.         std::map<long unsigned, std::array<unsigned, 7>> prefixes;
  7.        
  8.         void load_prefix_map(void);
  9.         void load_inst_map(void);
  10.         void load_reg_map(void);
  11.         void load_op_map(void);
  12.  
  13.         bool encode_instruction(std::vector<int>* bcode, unsigned in);
  14.         void encode_little_endian(std::vector<int>* bcode, long unsigned in);
  15.        
  16.     public:
  17.         std::map<std::string, std::array<unsigned, 7>> registers;
  18.        
  19.         void init(void);
  20.         int check_syntax(std::vector<std::string> line);
  21.         std::vector<int> assemble(std::vector<std::string> code, long unsigned prev_bytes);
  22. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement