Exemplo n.º 1
0
        public void SetMemory(long address, long initialValue)
        {
            long value = ApplyBitmaskFunction(initialValue);

            Console.WriteLine($"Setting memory at '{address}' from '{initialValue}' to '{value}'");
            if (MemoryMapping.ContainsKey(address))
            {
                MemoryMapping[address] = value;
            }
            else
            {
                MemoryMapping.Add(address, value);
            }
        }
Exemplo n.º 2
0
        public void SetMemory(long address, long value)
        {
            long[] addresses = ApplyBitmaskFunction(address).ToHashSet().ToArray();
            foreach (var addr in addresses)
            {
                Console.WriteLine($"Setting memory at '{addr}' from to '{value}'");

                if (MemoryMapping.ContainsKey(addr))
                {
                    MemoryMapping[addr] = value;
                }
                else
                {
                    MemoryMapping.Add(addr, value);
                }
            }
        }