Esempio n. 1
0
        /// <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;
        }
Esempio n. 2
0
 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));
         }
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Returns data from given address
 /// </summary>
 /// <param name="address">address</param>
 /// <returns>data</returns>
 public object Get(Address address)
 {
     return _memory[address.FullAddress];
 }
Esempio n. 4
0
 /// <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;
 }