1
0
mirror of https://github.com/livingcomputermuseum/sImlac.git synced 2026-02-26 00:43:51 +00:00

Made memory size configurable. Defaults to 8KW.

This commit is contained in:
Josh Dersch
2018-10-12 12:53:01 -07:00
parent d54292d346
commit 18bb3eb9bd
5 changed files with 70 additions and 10 deletions

View File

@@ -43,11 +43,11 @@ namespace imlac
{
_system = system;
_mem = _system.Memory;
_instructionCache = new Instruction[Memory.Size];
_iotDispatch = new IIOTDevice[0x200]; // 9 bits of IOT instructions
Reset();
InitializeCache();
}
public void Reset()
@@ -119,6 +119,11 @@ namespace imlac
return GetCachedInstruction(address).Disassemble(address);
}
public void InitializeCache()
{
_instructionCache = new Instruction[Memory.Size];
}
public void InvalidateCache(ushort address)
{
_instructionCache[address & Memory.SizeMask] = null;
@@ -578,7 +583,7 @@ namespace imlac
}
private ushort GetEffectiveAddress(ushort baseAddress)
{
{
return (ushort)((_pc & (Memory.SizeMask & 0xf800)) | (baseAddress & 0x07ff));
}