|
@@ -7,6 +7,7 @@ import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
import de.mcs.tools.sps.AbstractEmulator;
|
|
|
+import de.mcs.tools.sps.EmulatorOutput;
|
|
|
import de.mcs.tools.sps.SPSCommand;
|
|
|
import de.mcs.tools.sps.SPSCommandData;
|
|
|
import de.mcs.tools.sps.SPSCommandDataImpl;
|
|
@@ -20,6 +21,7 @@ import de.mcs.tools.sps.SPSEmulator;
|
|
|
public class HoltecEmulator extends AbstractEmulator implements SPSEmulator {
|
|
|
private List<SPSCommand> commands = new ArrayList<>();
|
|
|
{
|
|
|
+ commands.add(SPS_NOP);
|
|
|
commands.add(SPS_PORT);
|
|
|
commands.add(SPS_WAIT);
|
|
|
commands.add(SPS_JUMP_DOWN);
|
|
@@ -36,6 +38,13 @@ public class HoltecEmulator extends AbstractEmulator implements SPSEmulator {
|
|
|
commands.add(SPS_RETURN);
|
|
|
}
|
|
|
|
|
|
+ private static SPSCommand SPS_NOP = new SPSCommandImpl().setName("no operation").setMnemonic("NOP")
|
|
|
+ .setCommandByte((byte) 0x00);
|
|
|
+ static {
|
|
|
+ SPS_NOP.getCommandDatas().add(new SPSCommandDataImpl().setName("nop").setMnemonic("NOP")
|
|
|
+ .setCommandByte((byte) (SPS_NOP.getCommandByte())).setCommand(SPS_NOP));
|
|
|
+ }
|
|
|
+
|
|
|
private static SPSCommand SPS_PORT = new SPSCommandImpl().setName("Port Output").setMnemonic("PORT")
|
|
|
.setCommandByte((byte) 0x10);
|
|
|
|
|
@@ -290,4 +299,18 @@ public class HoltecEmulator extends AbstractEmulator implements SPSEmulator {
|
|
|
super.reset();
|
|
|
System.out.println("holtec emulator resettet");
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void callNextCommand() {
|
|
|
+ byte command = programMemory[address];
|
|
|
+ SPSCommandData commandData = getCommandData(command);
|
|
|
+ runCommand(commandData);
|
|
|
+ address++;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected EmulatorOutput getEmulatorOutput() {
|
|
|
+ return new EmulatorOutput() {
|
|
|
+ };
|
|
|
+ }
|
|
|
}
|