Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "../src/Decoder.h"
- #include "../src/Executor.h"
- #include "../src/Instruction.cpp"
- #include <cassert>
- int main() {
- Decoder decoder;
- Executor executor;
- Word encoded_instruction = 0b0000000'00101'00001'101'00111'0110011;
- InstructionPtr decoded_instruction = decoder.Decode(encoded_instruction);
- decoded_instruction->_src1Val = 15;
- decoded_instruction->_src2Val = 2;
- executor.Execute(decoded_instruction, 0);
- assert(decoded_instruction->_data == 3);
- assert(decoded_instruction->_nextIp == 4);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement