Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
        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);
        }