35 lines
715 B
C#
35 lines
715 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Barsik
|
|
{
|
|
class RegistersContainer
|
|
{
|
|
private Dictionary<int, int> registers;
|
|
|
|
public RegistersContainer()
|
|
{
|
|
registers = new Dictionary<int, int>();
|
|
}
|
|
|
|
public int this[int address]
|
|
{
|
|
get
|
|
{
|
|
lock(registers)
|
|
{
|
|
if (registers.ContainsKey(address)) return registers[address];
|
|
return 0;
|
|
}
|
|
}
|
|
set
|
|
{
|
|
lock (registers)
|
|
{
|
|
registers[address] = value;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|