From 82d80320adbf086fccdf0813d650dbc76073605a Mon Sep 17 00:00:00 2001 From: Daniel Kirschten Date: Mon, 7 Oct 2019 02:27:29 +0200 Subject: [PATCH] Added register for PC / BZ --- .../machine/AbstractAm2900MachineDefinition.java | 3 ++- .../model/am2900/machine/registers/PCRegister.java | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/registers/PCRegister.java diff --git a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/AbstractAm2900MachineDefinition.java b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/AbstractAm2900MachineDefinition.java index 0488e894..7096cd72 100644 --- a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/AbstractAm2900MachineDefinition.java +++ b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/AbstractAm2900MachineDefinition.java @@ -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 unsortedRegistersModifiable = new ArrayList<>(); unsortedRegistersModifiable.add(muInstrRegister.instance); unsortedRegistersModifiable.add(InstrRegister.instance); - // TODO PC/BZ... + unsortedRegistersModifiable.add(PCRegister.instance); unsortedRegisters = Collections.unmodifiableList(unsortedRegistersModifiable); List 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 index 00000000..9c082dd0 --- /dev/null +++ b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/registers/PCRegister.java @@ -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 -- 2.17.1