public static Byte2 Do(InstructionDecoder.Operation operation, Byte2 dataX, Byte2 dataY) { var transformedDataX = UnaryArithmeticLogicUnit.Do(operation.zx, operation.nx, dataX); var transformedDataY = UnaryArithmeticLogicUnit.Do(operation.zy, operation.ny, dataY); var and = Gates.And16(transformedDataX, transformedDataY); var add = Arithmetics.AddByte2(transformedDataX, transformedDataY, false); var selected = Select16.Do(operation.Function, add.Low, and); var inverted = Gates.Invert16(selected); var output = Select16.Do(operation.NegateOutput, inverted, selected); return(output); }