private static InstructionTargets Register(GetByte getByte) { return(new InstructionTargets(Type.Register) { GetByteValue = getByte, }); }
/// <summary> /// Gets a list of byte values using a callback function. /// </summary> /// <param name="n">Number of bytes to get.</param> /// <param name="getInt">Function to be called to get each byte.</param> /// <returns>CSV list of bytes.</returns> public static string GetByteList(int n, GetByte getByte) { if (n == 0) { return(null); } string list = ""; for (int i = 0; i < n; i++) { if (i > 0) { list += ","; } byte?value = getByte(i); if (value != null) { list += value.Value.ToString(); } } return(list); }