private void ValidateNewCode(ICode code)
        {
            IAssemblyInstructionForTransformation lastInstruction = null;
            var instructionEnumerator = code.AssemblyInstructions.GetEnumerator();

            while (instructionEnumerator.MoveNext())
            {
                if (lastInstruction != null && !instructionEnumerator.Current.IsNew &&
                    lastInstruction.Offset >= instructionEnumerator.Current.Offset)
                {
                    var instructionIndex = ((List <IAssemblyInstructionForTransformation>)code.AssemblyInstructions).IndexOf(instructionEnumerator.Current);
                    throw new ApplicationException($"Code structure is incorrect. instruction:{instructionEnumerator.Current.ToString()}" +
                                                   $"at index {instructionIndex} has higher or equal address than last instruction {lastInstruction.ToString()}");
                }
                if (!instructionEnumerator.Current.IsNew)
                {
                    lastInstruction = instructionEnumerator.Current;
                }
            }
        }