/// <summary> /// Gets data from block /// </summary> /// <param name="address">address</param> /// <returns>data</returns> public string GetBlock(Address address) { string data = ""; for (byte key = 0; key < MEMORY_SIZE_WORD; key++) { data += Get(new Address(address.Block, key)); } return data; }
public void SetBlock(List<MemoryCell> data, Address address) { for (byte key = 0; key < MEMORY_SIZE_WORD; key++) { if (data.Count > key && !String.IsNullOrEmpty(data[key].Value)) { Set(data[key], new Address(address.Block, key)); } else { Set(new MemoryCell() { Value = EMPTY_WORD_SYMBOL, Reserved = false }, new Address(address.Block, key)); } } }
/// <summary> /// Returns data from given address /// </summary> /// <param name="address">address</param> /// <returns>data</returns> public object Get(Address address) { return _memory[address.FullAddress]; }
/// <summary> /// Puts one word into given address /// </summary> /// <param name="data">data</param> /// <param name="address">address</param> public void Set(MemoryCell data, Address address) { _memory[address.FullAddress] = data; }