diff --git a/src/main/java/dk/camelot64/kickc/model/Registers.java b/src/main/java/dk/camelot64/kickc/model/Registers.java index a8d931a17..aed370e3b 100644 --- a/src/main/java/dk/camelot64/kickc/model/Registers.java +++ b/src/main/java/dk/camelot64/kickc/model/Registers.java @@ -16,32 +16,19 @@ public class Registers { return new RegisterAByte(); } - public static Register getRegisterASigned() { - return new RegisterASignedByte(); - } - - public static Register getRegisterXSigned() { - return new RegisterXSignedByte(); - } - - public static Register getRegisterYSigned() { - return new RegisterYSignedByte(); - } - public static Register getRegisterALU() { return new RegisterALUByte(); } /** The register type. */ public enum RegisterType { - REG_A_BYTE, REG_A_SBYTE, - REG_Y_BYTE, REG_Y_SBYTE, - REG_X_BYTE, REG_X_SBYTE, + REG_A_BYTE, + REG_Y_BYTE, + REG_X_BYTE, REG_ALU, - ZP_BYTE, ZP_SBYTE, + ZP_BYTE, ZP_PTR_BYTE, ZP_WORD, - ZP_SWORD, ZP_BOOL, CONSTANT } @@ -117,21 +104,6 @@ public class Registers { } - } - - /** A zero page address used as a register for a single signed byte variable. */ - public static class RegisterZpSignedByte extends RegisterZp { - - public RegisterZpSignedByte(int zp) { - super(zp); - } - - @Override - public RegisterType getType() { - return RegisterType.ZP_SBYTE; - } - - } /** Two zero page addresses used as a register for a single unsigned word variable. */ @@ -148,20 +120,6 @@ public class Registers { } - /** Two zero page addresses used as a register for a single signed word variable. */ - public static class RegisterZpSWord extends RegisterZp { - - public RegisterZpSWord(int zp) { - super(zp); - } - - @Override - public RegisterType getType() { - return RegisterType.ZP_SWORD; - } - - } - /** A zero page address used as a register for a boolean variable. */ public static class RegisterZpBool extends RegisterZp { @@ -271,49 +229,6 @@ public class Registers { } - /** The A signed register. */ - public static class RegisterASignedByte extends RegisterCpuByte { - @Override - public RegisterType getType() { - return RegisterType.REG_A_SBYTE; - } - - @Override - public String toString() { - return "reg sbyte a"; - } - - } - - /** The X signed register. */ - public static class RegisterXSignedByte extends RegisterCpuByte { - @Override - public RegisterType getType() { - return RegisterType.REG_X_SBYTE; - } - - @Override - public String toString() { - return "reg sbyte x"; - } - - } - - /** The Y signed register. */ - public static class RegisterYSignedByte extends RegisterCpuByte { - @Override - public RegisterType getType() { - return RegisterType.REG_Y_SBYTE; - } - - @Override - public String toString() { - return "reg sbyte y"; - } - - } - - /** The special ALU register. */ public static class RegisterALUByte extends RegisterCpuByte { @Override diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass4RegisterUpliftPotentialInitialize.java b/src/main/java/dk/camelot64/kickc/passes/Pass4RegisterUpliftPotentialInitialize.java index c7731cbb1..57acf50af 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass4RegisterUpliftPotentialInitialize.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass4RegisterUpliftPotentialInitialize.java @@ -30,13 +30,6 @@ public class Pass4RegisterUpliftPotentialInitialize extends Pass2Base { Registers.getRegisterX(), Registers.getRegisterY()); registerPotentials.setPotentialRegisters(equivalenceClass, potentials); - } else if (registerType.equals(Registers.RegisterType.ZP_SBYTE)) { - List potentials = Arrays.asList( - defaultRegister, - Registers.getRegisterASigned(), - Registers.getRegisterXSigned(), - Registers.getRegisterYSigned()); - registerPotentials.setPotentialRegisters(equivalenceClass, potentials); } else { registerPotentials.setPotentialRegisters(equivalenceClass, Arrays.asList(defaultRegister)); } diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass4RegistersFinalize.java b/src/main/java/dk/camelot64/kickc/passes/Pass4RegistersFinalize.java index bbaa05713..86b3e468f 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass4RegistersFinalize.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass4RegistersFinalize.java @@ -144,10 +144,10 @@ public class Pass4RegistersFinalize extends Pass2Base { currentZp = currentZp + 2; return registerZpWord; } else if (SymbolType.isSWord(varType)) { - Registers.RegisterZpSWord registerZpSWord = - new Registers.RegisterZpSWord(currentZp); + Registers.RegisterZpWord registerZpWord = + new Registers.RegisterZpWord(currentZp); currentZp = currentZp + 2; - return registerZpSWord; + return registerZpWord; } else if (varType.equals(SymbolType.BOOLEAN)) { return new Registers.RegisterZpBool(currentZp++); } else if (varType.equals(SymbolType.VOID)) {