Converted address to 16-bit binary string rather than byte.
This commit is contained in:
@@ -27,18 +27,18 @@ namespace CPUSimulation
|
||||
}
|
||||
}
|
||||
|
||||
public Word Read(int address)
|
||||
public Word Read(Int16 address)
|
||||
{
|
||||
AddressOkay(address);
|
||||
Byte[] byteData = new Byte[_numberOfMemoryBanks];
|
||||
for (int i = 0; i < _numberOfMemoryBanks; i++)
|
||||
{
|
||||
byteData[i] = _memoryBanks[i].Read((byte)address);
|
||||
byteData[i] = _memoryBanks[i].Read(new Address(address).ToString());
|
||||
}
|
||||
return new Word(byteData);
|
||||
}
|
||||
|
||||
public void Write(int address, Word data)
|
||||
public void Write(Int16 address, Word data)
|
||||
{
|
||||
AddressOkay(address);
|
||||
Byte[] byteData = data.GetBytes();
|
||||
@@ -72,11 +72,11 @@ namespace CPUSimulation
|
||||
|
||||
for (int i = 0; i < _numberOfMemoryBanks; i++)
|
||||
{
|
||||
_memoryBanks[i].Write((byte)address, bytesToWrite[i]);
|
||||
_memoryBanks[i].Write(new Address(address).ToString(), bytesToWrite[i]);
|
||||
}
|
||||
}
|
||||
|
||||
private void AddressOkay(int address)
|
||||
private void AddressOkay(Int16 address)
|
||||
{
|
||||
if (address < 0 || address >= _memoryBankSize)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user