Advertisement
Guest User

Untitled

a guest
Apr 4th, 2020
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. #include "../src/Decoder.h"
  2. #include "../src/Executor.h"
  3. #include "../src/Instruction.cpp"
  4. #include <cassert>
  5.  
  6. int main() {
  7.     Decoder decoder;
  8.     Executor executor;
  9.     Word encoded_instruction = 0b0000000'00101'00001'101'00111'0110011;
  10.    InstructionPtr decoded_instruction = decoder.Decode(encoded_instruction);
  11.    decoded_instruction->_src1Val = 15;
  12.    decoded_instruction->_src2Val = 2;
  13.    executor.Execute(decoded_instruction, 0);
  14.    assert(decoded_instruction->_data == 3);
  15.    assert(decoded_instruction->_nextIp == 4);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement