public RandomAccessMemory(ushort beginAddress, ReadOnlySpan <byte> memory, MemoryLines connections) { _memory = memory.ToArray(); BeginAddress = beginAddress; EndAddress = (ushort)(beginAddress + _memory.Length - 1); Connections = connections; Connections.AttachMemory(this); }
public RandomAccessMemory(ushort beginAddress, int size, MemoryLines connections) { if (size < 1) { throw new ArgumentOutOfRangeException(nameof(size), "Size must be greater than zero"); } _memory = new byte[size]; BeginAddress = beginAddress; EndAddress = (ushort)(beginAddress + _memory.Length - 1); Connections = connections; Connections.AttachMemory(this); }