fixed PC (#6)

Co-authored-by: Darkress <30271678+DarkressX@users.noreply.github.com>
Reviewed-on: darkress/pic16f84-sim#6
This commit was merged in pull request #6.
This commit is contained in:
darkress
2023-05-31 14:22:45 +02:00
parent 2cfc14ba78
commit 0b5d0c172a
4 changed files with 23 additions and 18 deletions

View File

@@ -59,6 +59,10 @@ public class Memory
}
memory[address] = data;
memory[address + 128] = data; //Ensure data is written to both banks to simulate mapping
if(address == 0x2) //Check if PCL is destination
{
ProgramCounter.loadPc();
}
}
private static int getDataFromIndirectAddress(int address)
@@ -75,6 +79,10 @@ public class Memory
}
memory[address % 128] = data; // else: Registers.Registers which are mapped
memory[address % 128 + 128] = data; //Ensure data is written to both banks to simulate mapping
if(address == 0x2) //Check if PCL is destination
{
ProgramCounter.loadPc();
}
}
private static int getRegisterBank()