IOPorts interactive

This commit is contained in:
2024-05-04 15:08:03 +02:00
parent d7ea62963f
commit 3590779e74
6 changed files with 451 additions and 159 deletions

View File

@ -34,7 +34,7 @@ public class DataRegister {
dataRegister[0x81] = 0b11111111;
dataRegister[0x80 + PCL] = dataRegister[PCL];
dataRegister[0x80 + STATUS] = dataRegister[STATUS];
dataRegister[TRISA] = 0b11111000;
dataRegister[TRISA] = 0b11111111;
dataRegister[TRISB] = 0b11111111;
dataRegister[0x80 + PCLATH] = dataRegister[PCLATH];
dataRegister[0x80 + INTCON] = dataRegister[INTCON];
@ -139,6 +139,14 @@ public class DataRegister {
}
}
public static void setDirectBit (int fileAddress, int bit, int value){
if (getDirectBit(fileAddress, bit) == 0 && value == 1){
dataRegister[fileAddress] += (int) Math.pow(2, bit);
} else if (getDirectBit(fileAddress, bit) == 1 && value == 0){
dataRegister[fileAddress] -= (int) Math.pow(2, bit);
}
}
private static int programCounter = 0;
private static void writeToPCL(){