Example #1
0
 public void SetByte(int adress, byte value)
 {
     if (adress > Size)
     {
         throw new IndexOutOfRangeException("Adress out of addresable memory: " + adress.ToString());
     }
     Locations[adress] = value;
     MemoryByteModified?.Invoke(this, new MemoryByteModifiedEventArgs(adress, value));
     MemoryModified?.Invoke(this, new MemoryModifiedEventArgs(adress, 8));
 }
Example #2
0
 public void SetWord(int adress, ushort value)
 {
     if (adress > Size)
     {
         throw new IndexOutOfRangeException("Adress out of addresable memory: " + adress.ToString());
     }
     Locations[adress]     = (byte)value;
     Locations[adress + 1] = (byte)(value >> 8);
     MemoryWordModified?.Invoke(this, new MemoryWordModifiedEventArgs(adress, value));
     MemoryModified?.Invoke(this, new MemoryModifiedEventArgs(adress, 16));
 }
Example #3
0
 public void SetQWord(int adress, UInt64 value)
 {
     if (adress > Size)
     {
         throw new IndexOutOfRangeException("Adress out of addresable memory: " + adress.ToString());
     }
     Locations[adress]     = (byte)value;
     Locations[adress + 1] = (byte)(value >> 8);
     Locations[adress + 2] = (byte)(value >> 16);
     Locations[adress + 3] = (byte)(value >> 24);
     Locations[adress + 4] = (byte)(value >> 32);
     Locations[adress + 5] = (byte)(value >> 40);
     Locations[adress + 6] = (byte)(value >> 48);
     Locations[adress + 7] = (byte)(value >> 56);
     MemoryQWordModified?.Invoke(this, new MemoryQWordModifiedEventArgs(adress, value));
     MemoryModified?.Invoke(this, new MemoryModifiedEventArgs(adress, 64));
 }