Added register for PC / BZ
authorDaniel Kirschten <daniel.kirschten@gmx.de>
Mon, 7 Oct 2019 00:27:29 +0000 (02:27 +0200)
committerDaniel Kirschten <daniel.kirschten@gmx.de>
Mon, 7 Oct 2019 00:27:29 +0000 (02:27 +0200)
plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/AbstractAm2900MachineDefinition.java
plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/registers/PCRegister.java [new file with mode: 0644]

index 0488e89..7096cd7 100644 (file)
@@ -5,6 +5,7 @@ import java.util.Collections;
 import java.util.List;
 
 import net.mograsim.logic.model.am2900.machine.registers.InstrRegister;
+import net.mograsim.logic.model.am2900.machine.registers.PCRegister;
 import net.mograsim.logic.model.am2900.machine.registers.muInstrRegister;
 import net.mograsim.logic.model.am2900.machine.registers.am2901.Am2901RegisterGroup;
 import net.mograsim.logic.model.am2900.machine.registers.am2904.Am2904RegisterGroup;
@@ -30,7 +31,7 @@ public class AbstractAm2900MachineDefinition implements MachineDefinition
                List<Register> unsortedRegistersModifiable = new ArrayList<>();
                unsortedRegistersModifiable.add(muInstrRegister.instance);
                unsortedRegistersModifiable.add(InstrRegister.instance);
-               // TODO PC/BZ...
+               unsortedRegistersModifiable.add(PCRegister.instance);
                unsortedRegisters = Collections.unmodifiableList(unsortedRegistersModifiable);
                List<RegisterGroup> registerGroupsModifiable = new ArrayList<>();
                registerGroupsModifiable.add(Am2901RegisterGroup.instance);
diff --git a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/registers/PCRegister.java b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/registers/PCRegister.java
new file mode 100644 (file)
index 0000000..9c082dd
--- /dev/null
@@ -0,0 +1,14 @@
+package net.mograsim.logic.model.am2900.machine.registers;
+
+import net.mograsim.logic.model.am2900.machine.registers.Am2900Register;
+import net.mograsim.machine.registers.HighLevelStateBasedRegister;
+
+public class PCRegister extends HighLevelStateBasedRegister implements Am2900Register
+{
+       public static final PCRegister instance = new PCRegister();
+
+       private PCRegister()
+       {
+               super("PC", "pc.q", 16);
+       }
+}
\ No newline at end of file