|
@@ -0,0 +1,288 @@
|
|
|
|
+/**
|
|
|
|
+ *
|
|
|
|
+ */
|
|
|
|
+package de.mcs.tools.sps.holtec;
|
|
|
|
+
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
|
|
+import de.mcs.tools.sps.AbstractEmulator;
|
|
|
|
+import de.mcs.tools.sps.SPSCommand;
|
|
|
|
+import de.mcs.tools.sps.SPSCommandData;
|
|
|
|
+import de.mcs.tools.sps.SPSCommandDataImpl;
|
|
|
|
+import de.mcs.tools.sps.SPSCommandImpl;
|
|
|
|
+import de.mcs.tools.sps.SPSEmulator;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @author w.klaas
|
|
|
|
+ *
|
|
|
|
+ */
|
|
|
|
+public class HoltecEmulator extends AbstractEmulator implements SPSEmulator {
|
|
|
|
+ private List<SPSCommand> commands = new ArrayList<>();
|
|
|
|
+ {
|
|
|
|
+ commands.add(SPS_PORT);
|
|
|
|
+ commands.add(SPS_WAIT);
|
|
|
|
+ commands.add(SPS_JUMP_DOWN);
|
|
|
|
+ commands.add(SPS_A_EQUALS);
|
|
|
|
+ commands.add(SPS_EQUALS_A);
|
|
|
|
+ commands.add(SPS_A_INPUT);
|
|
|
|
+ commands.add(SPS_A_CALCULATE);
|
|
|
|
+ commands.add(SPS_PAGE);
|
|
|
|
+ commands.add(SPS_JUMP_UP);
|
|
|
|
+ commands.add(SPS_C_LOOP);
|
|
|
|
+ commands.add(SPS_D_LOOP);
|
|
|
|
+ commands.add(SPS_SKIP_IF);
|
|
|
|
+ commands.add(SPS_CALL);
|
|
|
|
+ commands.add(SPS_RETURN);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static SPSCommand SPS_PORT = new SPSCommandImpl().setName("Port Output").setMnemonic("PORT")
|
|
|
|
+ .setCommandByte((byte) 0x10);
|
|
|
|
+
|
|
|
|
+ static {
|
|
|
|
+ for (int i = 0; i < 16; i++) {
|
|
|
|
+ SPS_PORT.getCommandDatas()
|
|
|
|
+ .add(new SPSCommandDataImpl().setName("Port " + Integer.toString(i)).setMnemonic("PO" + Integer.toString(i))
|
|
|
|
+ .setCommandByte((byte) (SPS_PORT.getCommandByte() + i)).setCommand(SPS_PORT));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static SPSCommand SPS_WAIT = new SPSCommandImpl().setName("WAIT").setMnemonic("WAIT")
|
|
|
|
+ .setCommandByte((byte) 0x20);
|
|
|
|
+ static {
|
|
|
|
+ List<SPSCommandData> datas = SPS_WAIT.getCommandDatas();
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("Wait 1ms").setMnemonic("D1M")
|
|
|
|
+ .setCommandByte((byte) SPS_WAIT.getCommandByte()).setCommand(SPS_WAIT));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("Wait 2ms").setMnemonic("D2M")
|
|
|
|
+ .setCommandByte((byte) SPS_WAIT.getCommandByte()).setCommand(SPS_WAIT));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("Wait 5ms").setMnemonic("D5M")
|
|
|
|
+ .setCommandByte((byte) SPS_WAIT.getCommandByte()).setCommand(SPS_WAIT));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("Wait 10ms").setMnemonic("D10M")
|
|
|
|
+ .setCommandByte((byte) SPS_WAIT.getCommandByte()).setCommand(SPS_WAIT));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("Wait 20ms").setMnemonic("D20M")
|
|
|
|
+ .setCommandByte((byte) SPS_WAIT.getCommandByte()).setCommand(SPS_WAIT));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("Wait 50ms").setMnemonic("D50M")
|
|
|
|
+ .setCommandByte((byte) SPS_WAIT.getCommandByte()).setCommand(SPS_WAIT));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("Wait 100ms").setMnemonic("D100M")
|
|
|
|
+ .setCommandByte((byte) SPS_WAIT.getCommandByte()).setCommand(SPS_WAIT));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("Wait 200ms").setMnemonic("D200M")
|
|
|
|
+ .setCommandByte((byte) SPS_WAIT.getCommandByte()).setCommand(SPS_WAIT));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("Wait 500ms").setMnemonic("D500M")
|
|
|
|
+ .setCommandByte((byte) SPS_WAIT.getCommandByte()).setCommand(SPS_WAIT));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("Wait 1s").setMnemonic("D1S")
|
|
|
|
+ .setCommandByte((byte) SPS_WAIT.getCommandByte()).setCommand(SPS_WAIT));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("Wait 2s").setMnemonic("D2S")
|
|
|
|
+ .setCommandByte((byte) SPS_WAIT.getCommandByte()).setCommand(SPS_WAIT));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("Wait 5s").setMnemonic("D5S")
|
|
|
|
+ .setCommandByte((byte) SPS_WAIT.getCommandByte()).setCommand(SPS_WAIT));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("Wait 10s").setMnemonic("D10S")
|
|
|
|
+ .setCommandByte((byte) SPS_WAIT.getCommandByte()).setCommand(SPS_WAIT));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("Wait 20s").setMnemonic("D20S")
|
|
|
|
+ .setCommandByte((byte) SPS_WAIT.getCommandByte()).setCommand(SPS_WAIT));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("Wait 30s").setMnemonic("D30S")
|
|
|
|
+ .setCommandByte((byte) SPS_WAIT.getCommandByte()).setCommand(SPS_WAIT));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("Wait 60s").setMnemonic("D60S")
|
|
|
|
+ .setCommandByte((byte) SPS_WAIT.getCommandByte()).setCommand(SPS_WAIT));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static SPSCommand SPS_JUMP_DOWN = new SPSCommandImpl().setName("jump back").setMnemonic("JMP-")
|
|
|
|
+ .setCommandByte((byte) 0x30);
|
|
|
|
+ static {
|
|
|
|
+ for (int i = 0; i < 16; i++) {
|
|
|
|
+ SPS_JUMP_DOWN.getCommandDatas()
|
|
|
|
+ .add(new SPSCommandDataImpl().setName("Jump -" + Integer.toString(i)).setMnemonic("JN" + Integer.toString(i))
|
|
|
|
+ .setCommandByte((byte) (SPS_JUMP_DOWN.getCommandByte() + i)).setCommand(SPS_JUMP_DOWN));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static SPSCommand SPS_A_EQUALS = new SPSCommandImpl().setName("Set A").setMnemonic("A=")
|
|
|
|
+ .setCommandByte((byte) 0x40);
|
|
|
|
+ static {
|
|
|
|
+ for (int i = 0; i < 16; i++) {
|
|
|
|
+ SPS_A_EQUALS.getCommandDatas()
|
|
|
|
+ .add(new SPSCommandDataImpl().setName("A= " + Integer.toString(i)).setMnemonic(String.format("A%02d", i))
|
|
|
|
+ .setCommandByte((byte) (SPS_A_EQUALS.getCommandByte() + i)).setCommand(SPS_A_EQUALS));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static SPSCommand SPS_EQUALS_A = new SPSCommandImpl().setName("=A").setMnemonic("=A")
|
|
|
|
+ .setCommandByte((byte) 0x50);
|
|
|
|
+ static {
|
|
|
|
+ List<SPSCommandData> datas = SPS_EQUALS_A.getCommandDatas();
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("B=A").setMnemonic("BEA")
|
|
|
|
+ .setCommandByte((byte) (SPS_EQUALS_A.getCommandByte() + 0x01)).setCommand(SPS_EQUALS_A));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("C=A").setMnemonic("CEA")
|
|
|
|
+ .setCommandByte((byte) (SPS_EQUALS_A.getCommandByte() + 0x02)).setCommand(SPS_EQUALS_A));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("D=A").setMnemonic("DEA")
|
|
|
|
+ .setCommandByte((byte) (SPS_EQUALS_A.getCommandByte() + 0x03)).setCommand(SPS_EQUALS_A));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("Output=A").setMnemonic("OEA")
|
|
|
|
+ .setCommandByte((byte) (SPS_EQUALS_A.getCommandByte() + 0x04)).setCommand(SPS_EQUALS_A));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("Output.1=A").setMnemonic("O1EA")
|
|
|
|
+ .setCommandByte((byte) (SPS_EQUALS_A.getCommandByte() + 0x05)).setCommand(SPS_EQUALS_A));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("Output.2=A").setMnemonic("O2EA")
|
|
|
|
+ .setCommandByte((byte) (SPS_EQUALS_A.getCommandByte() + 0x06)).setCommand(SPS_EQUALS_A));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("Output.3=A").setMnemonic("O3EA")
|
|
|
|
+ .setCommandByte((byte) (SPS_EQUALS_A.getCommandByte() + 0x07)).setCommand(SPS_EQUALS_A));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("Output.4=A").setMnemonic("O4EA")
|
|
|
|
+ .setCommandByte((byte) (SPS_EQUALS_A.getCommandByte() + 0x08)).setCommand(SPS_EQUALS_A));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("PWM=A").setMnemonic("PEA")
|
|
|
|
+ .setCommandByte((byte) (SPS_EQUALS_A.getCommandByte() + 0x09)).setCommand(SPS_EQUALS_A));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static SPSCommand SPS_A_INPUT = new SPSCommandImpl().setName("A=(some input)").setMnemonic("AEI")
|
|
|
|
+ .setCommandByte((byte) 0x60);
|
|
|
|
+ static {
|
|
|
|
+ List<SPSCommandData> datas = SPS_A_INPUT.getCommandDatas();
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("A=B").setMnemonic("AEB")
|
|
|
|
+ .setCommandByte((byte) (SPS_A_INPUT.getCommandByte() + 0x01)).setCommand(SPS_A_INPUT));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("A=C").setMnemonic("AEC")
|
|
|
|
+ .setCommandByte((byte) (SPS_A_INPUT.getCommandByte() + 0x02)).setCommand(SPS_A_INPUT));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("A=D").setMnemonic("AED")
|
|
|
|
+ .setCommandByte((byte) (SPS_A_INPUT.getCommandByte() + 0x03)).setCommand(SPS_A_INPUT));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("A=Input").setMnemonic("AEI")
|
|
|
|
+ .setCommandByte((byte) (SPS_A_INPUT.getCommandByte() + 0x04)).setCommand(SPS_A_INPUT));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("A=Input.1").setMnemonic("AEI1")
|
|
|
|
+ .setCommandByte((byte) (SPS_A_INPUT.getCommandByte() + 0x05)).setCommand(SPS_A_INPUT));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("A=Input.2").setMnemonic("AEI2")
|
|
|
|
+ .setCommandByte((byte) (SPS_A_INPUT.getCommandByte() + 0x06)).setCommand(SPS_A_INPUT));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("A=Input.3").setMnemonic("AEI3")
|
|
|
|
+ .setCommandByte((byte) (SPS_A_INPUT.getCommandByte() + 0x07)).setCommand(SPS_A_INPUT));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("A=Input.4").setMnemonic("AEI4")
|
|
|
|
+ .setCommandByte((byte) (SPS_A_INPUT.getCommandByte() + 0x08)).setCommand(SPS_A_INPUT));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("A=AD.1").setMnemonic("AEA1")
|
|
|
|
+ .setCommandByte((byte) (SPS_A_INPUT.getCommandByte() + 0x09)).setCommand(SPS_A_INPUT));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("A=AD.2").setMnemonic("AEA2")
|
|
|
|
+ .setCommandByte((byte) (SPS_A_INPUT.getCommandByte() + 0x0A)).setCommand(SPS_A_INPUT));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static SPSCommand SPS_A_CALCULATE = new SPSCommandImpl().setName("Calculate with A").setMnemonic("CALC")
|
|
|
|
+ .setCommandByte((byte) 0x70);
|
|
|
|
+ static {
|
|
|
|
+ List<SPSCommandData> datas = SPS_A_CALCULATE.getCommandDatas();
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("A=A+1").setMnemonic("INCA")
|
|
|
|
+ .setCommandByte((byte) (SPS_A_CALCULATE.getCommandByte() + 0x01)).setCommand(SPS_A_CALCULATE));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("A=A-1").setMnemonic("DECA")
|
|
|
|
+ .setCommandByte((byte) (SPS_A_CALCULATE.getCommandByte() + 0x02)).setCommand(SPS_A_CALCULATE));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("A=A+B").setMnemonic("ADDB")
|
|
|
|
+ .setCommandByte((byte) (SPS_A_CALCULATE.getCommandByte() + 0x03)).setCommand(SPS_A_CALCULATE));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("A=A-B").setMnemonic("SUBB")
|
|
|
|
+ .setCommandByte((byte) (SPS_A_CALCULATE.getCommandByte() + 0x04)).setCommand(SPS_A_CALCULATE));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("A=A*B").setMnemonic("MULB")
|
|
|
|
+ .setCommandByte((byte) (SPS_A_CALCULATE.getCommandByte() + 0x05)).setCommand(SPS_A_CALCULATE));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("A=A/B").setMnemonic("DIVB")
|
|
|
|
+ .setCommandByte((byte) (SPS_A_CALCULATE.getCommandByte() + 0x06)).setCommand(SPS_A_CALCULATE));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("A=A AND B").setMnemonic("ANDB")
|
|
|
|
+ .setCommandByte((byte) (SPS_A_CALCULATE.getCommandByte() + 0x07)).setCommand(SPS_A_CALCULATE));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("A=A OR B").setMnemonic("ORB")
|
|
|
|
+ .setCommandByte((byte) (SPS_A_CALCULATE.getCommandByte() + 0x08)).setCommand(SPS_A_CALCULATE));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("A=A XOR B").setMnemonic("XORB")
|
|
|
|
+ .setCommandByte((byte) (SPS_A_CALCULATE.getCommandByte() + 0x09)).setCommand(SPS_A_CALCULATE));
|
|
|
|
+ datas.add(new SPSCommandDataImpl().setName("A=NOT A").setMnemonic("NOTA")
|
|
|
|
+ .setCommandByte((byte) (SPS_A_CALCULATE.getCommandByte() + 0x0A)).setCommand(SPS_A_CALCULATE));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static SPSCommand SPS_PAGE = new SPSCommandImpl().setName("Page").setMnemonic("PG")
|
|
|
|
+ .setCommandByte((byte) 0x80);
|
|
|
|
+ static {
|
|
|
|
+ for (int i = 0; i < 8; i++) {
|
|
|
|
+ SPS_PAGE.getCommandDatas()
|
|
|
|
+ .add(new SPSCommandDataImpl().setName("Page " + Integer.toString(i)).setMnemonic("PG" + Integer.toString(i))
|
|
|
|
+ .setCommandByte((byte) (SPS_PAGE.getCommandByte() + i)).setCommand(SPS_PAGE));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static SPSCommand SPS_JUMP_UP = new SPSCommandImpl().setName("Jump").setMnemonic("JMP")
|
|
|
|
+ .setCommandByte((byte) 0x90);
|
|
|
|
+ static {
|
|
|
|
+ for (int i = 0; i < 16; i++) {
|
|
|
|
+ SPS_JUMP_UP.getCommandDatas()
|
|
|
|
+ .add(new SPSCommandDataImpl().setName("Jump " + Integer.toString(i)).setMnemonic("JMP" + Integer.toString(i))
|
|
|
|
+ .setCommandByte((byte) (SPS_JUMP_UP.getCommandByte() + i)).setCommand(SPS_JUMP_UP));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static SPSCommand SPS_C_LOOP = new SPSCommandImpl().setName("C* Loop").setMnemonic("CLOP")
|
|
|
|
+ .setCommandByte((byte) 0xA0);
|
|
|
|
+ static {
|
|
|
|
+ for (int i = 0; i < 16; i++) {
|
|
|
|
+ SPS_C_LOOP.getCommandDatas()
|
|
|
|
+ .add(new SPSCommandDataImpl().setName("C* Loop " + Integer.toString(i))
|
|
|
|
+ .setMnemonic("CLOP" + Integer.toString(i)).setCommandByte((byte) (SPS_C_LOOP.getCommandByte() + i))
|
|
|
|
+ .setCommand(SPS_C_LOOP));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static SPSCommand SPS_D_LOOP = new SPSCommandImpl().setName("D* Loop").setMnemonic("DLOP")
|
|
|
|
+ .setCommandByte((byte) 0xB0);
|
|
|
|
+ static {
|
|
|
|
+ for (int i = 0; i < 16; i++) {
|
|
|
|
+ SPS_D_LOOP.getCommandDatas()
|
|
|
|
+ .add(new SPSCommandDataImpl().setName("D* Loop " + Integer.toString(i))
|
|
|
|
+ .setMnemonic("DLOP" + Integer.toString(i)).setCommandByte((byte) (SPS_D_LOOP.getCommandByte() + i))
|
|
|
|
+ .setCommand(SPS_D_LOOP));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static SPSCommand SPS_SKIP_IF = new SPSCommandImpl().setName("Skip if").setMnemonic("SKIP")
|
|
|
|
+ .setCommandByte((byte) 0xC0);
|
|
|
|
+ static {
|
|
|
|
+ SPS_SKIP_IF.getCommandDatas().add(new SPSCommandDataImpl().setName("A>B").setMnemonic("AGRB")
|
|
|
|
+ .setCommandByte((byte) (SPS_SKIP_IF.getCommandByte() + 0x01)).setCommand(SPS_SKIP_IF));
|
|
|
|
+ SPS_SKIP_IF.getCommandDatas().add(new SPSCommandDataImpl().setName("A<B").setMnemonic("ASMB")
|
|
|
|
+ .setCommandByte((byte) (SPS_SKIP_IF.getCommandByte() + 0x02)).setCommand(SPS_SKIP_IF));
|
|
|
|
+ SPS_SKIP_IF.getCommandDatas().add(new SPSCommandDataImpl().setName("A=B").setMnemonic("AEQB")
|
|
|
|
+ .setCommandByte((byte) (SPS_SKIP_IF.getCommandByte() + 0x03)).setCommand(SPS_SKIP_IF));
|
|
|
|
+ SPS_SKIP_IF.getCommandDatas().add(new SPSCommandDataImpl().setName("In.1=1").setMnemonic("IN11")
|
|
|
|
+ .setCommandByte((byte) (SPS_SKIP_IF.getCommandByte() + 0x04)).setCommand(SPS_SKIP_IF));
|
|
|
|
+ SPS_SKIP_IF.getCommandDatas().add(new SPSCommandDataImpl().setName("In.2=1").setMnemonic("IN21")
|
|
|
|
+ .setCommandByte((byte) (SPS_SKIP_IF.getCommandByte() + 0x05)).setCommand(SPS_SKIP_IF));
|
|
|
|
+ SPS_SKIP_IF.getCommandDatas().add(new SPSCommandDataImpl().setName("In.3=1").setMnemonic("IN31")
|
|
|
|
+ .setCommandByte((byte) (SPS_SKIP_IF.getCommandByte() + 0x06)).setCommand(SPS_SKIP_IF));
|
|
|
|
+ SPS_SKIP_IF.getCommandDatas().add(new SPSCommandDataImpl().setName("In.4=1").setMnemonic("IN41")
|
|
|
|
+ .setCommandByte((byte) (SPS_SKIP_IF.getCommandByte() + 0x07)).setCommand(SPS_SKIP_IF));
|
|
|
|
+ SPS_SKIP_IF.getCommandDatas().add(new SPSCommandDataImpl().setName("In.1=0").setMnemonic("IN10")
|
|
|
|
+ .setCommandByte((byte) (SPS_SKIP_IF.getCommandByte() + 0x08)).setCommand(SPS_SKIP_IF));
|
|
|
|
+ SPS_SKIP_IF.getCommandDatas().add(new SPSCommandDataImpl().setName("In.2=0").setMnemonic("IN20")
|
|
|
|
+ .setCommandByte((byte) (SPS_SKIP_IF.getCommandByte() + 0x09)).setCommand(SPS_SKIP_IF));
|
|
|
|
+ SPS_SKIP_IF.getCommandDatas().add(new SPSCommandDataImpl().setName("In.3=0").setMnemonic("IN30")
|
|
|
|
+ .setCommandByte((byte) (SPS_SKIP_IF.getCommandByte() + 0x0A)).setCommand(SPS_SKIP_IF));
|
|
|
|
+ SPS_SKIP_IF.getCommandDatas().add(new SPSCommandDataImpl().setName("In.4=0").setMnemonic("IN40")
|
|
|
|
+ .setCommandByte((byte) (SPS_SKIP_IF.getCommandByte() + 0x0B)).setCommand(SPS_SKIP_IF));
|
|
|
|
+ SPS_SKIP_IF.getCommandDatas().add(new SPSCommandDataImpl().setName("S1=0").setMnemonic("S10")
|
|
|
|
+ .setCommandByte((byte) (SPS_SKIP_IF.getCommandByte() + 0x0C)).setCommand(SPS_SKIP_IF));
|
|
|
|
+ SPS_SKIP_IF.getCommandDatas().add(new SPSCommandDataImpl().setName("S2=0").setMnemonic("S20")
|
|
|
|
+ .setCommandByte((byte) (SPS_SKIP_IF.getCommandByte() + 0x0D)).setCommand(SPS_SKIP_IF));
|
|
|
|
+ SPS_SKIP_IF.getCommandDatas().add(new SPSCommandDataImpl().setName("S1=1").setMnemonic("S11")
|
|
|
|
+ .setCommandByte((byte) (SPS_SKIP_IF.getCommandByte() + 0x0E)).setCommand(SPS_SKIP_IF));
|
|
|
|
+ SPS_SKIP_IF.getCommandDatas().add(new SPSCommandDataImpl().setName("S2=1").setMnemonic("S21")
|
|
|
|
+ .setCommandByte((byte) (SPS_SKIP_IF.getCommandByte() + 0x0F)).setCommand(SPS_SKIP_IF));
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ private static SPSCommand SPS_CALL = new SPSCommandImpl().setName("Call").setMnemonic("CALL")
|
|
|
|
+ .setCommandByte((byte) 0xD0);
|
|
|
|
+ static {
|
|
|
|
+ for (int i = 0; i < 16; i++) {
|
|
|
|
+ SPS_CALL.getCommandDatas()
|
|
|
|
+ .add(new SPSCommandDataImpl().setName("Call " + Integer.toString(i)).setMnemonic("CALL" + Integer.toString(i))
|
|
|
|
+ .setCommandByte((byte) (SPS_CALL.getCommandByte() + i)).setCommand(SPS_CALL));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static SPSCommand SPS_RETURN = new SPSCommandImpl().setName("return").setMnemonic("RET")
|
|
|
|
+ .setCommandByte((byte) 0xE0);
|
|
|
|
+ static {
|
|
|
|
+ SPS_RETURN.getCommandDatas().add(new SPSCommandDataImpl().setName("Return").setMnemonic("RET")
|
|
|
|
+ .setCommandByte((byte) (SPS_RETURN.getCommandByte())).setCommand(SPS_RETURN));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<SPSCommand> getCommands() {
|
|
|
|
+ return commands;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public int getProgramSize() {
|
|
|
|
+ return 128;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|