public void Add_Gv_Ev()
        {
            byte expectedOpByte = 0x03;

            var opCode = OpCode.Create(OpType.Add, OpCodeDirection.RMToReg, true);

            var opByte = opCode.GetBytes().Single();

            Assert.Equal(expectedOpByte, opByte);
        }
        public void Add_Ev_Iv()
        {
            byte expectedOpByte = 0x81;

            var opCode = OpCode.Create(OpType.Add, OpCodeDirection.RegToRM, true, isImmediate: true);

            var opByte = opCode.GetBytes().Single();

            Assert.Equal(expectedOpByte, opByte);
        }
        public void Add_Eb_Gb()
        {
            byte expectedOpByte = 0x00;

            var opCode = OpCode.Create(OpType.Add, OpCodeDirection.RegToRM);

            var opByte = opCode.GetBytes().Single();

            Assert.Equal(expectedOpByte, opByte);
        }
        public void Add_rAX_Iz()
        {
            byte expectedOpByte = 0x05;

            var opCode      = OpCode.Create(OpType.Add, OpCodeDirection.RegToRM, true, isImmediate: true);
            var instruction = new Instruction(opCode, new ModRegRM(Mod.E4, Register.None, Register.AX), constant: 42);

            var opByte = instruction.Encode().First();

            Assert.Equal(expectedOpByte, opByte);
        }
        public void EmitOpCode()
        {
            var instructionGenerator = new InstructionGenerator();

            instructionGenerator.Emit(OpCode.Create(OpType.Add));
        }