diff --git a/bin/Model/Microcontroller/ALU.class b/bin/Model/Microcontroller/ALU.class index bee62df..f28782d 100644 Binary files a/bin/Model/Microcontroller/ALU.class and b/bin/Model/Microcontroller/ALU.class differ diff --git a/bin/Model/Microcontroller/PIC.class b/bin/Model/Microcontroller/PIC.class index 50a09be..9b66730 100644 Binary files a/bin/Model/Microcontroller/PIC.class and b/bin/Model/Microcontroller/PIC.class differ diff --git a/bin/View/GUIRamTable.class b/bin/View/GUIRamTable.class index 351374d..bd7aa49 100644 Binary files a/bin/View/GUIRamTable.class and b/bin/View/GUIRamTable.class differ diff --git a/bin/View/GUITestFileTable.class b/bin/View/GUITestFileTable.class index 1598f0d..4dfbb88 100644 Binary files a/bin/View/GUITestFileTable.class and b/bin/View/GUITestFileTable.class differ diff --git a/src/Model/Microcontroller/ALU.java b/src/Model/Microcontroller/ALU.java index 9947e55..d28e135 100644 --- a/src/Model/Microcontroller/ALU.java +++ b/src/Model/Microcontroller/ALU.java @@ -29,7 +29,7 @@ public class ALU { * @param bSubtractionBit * @return */ - public int calcValue(int iValue1, int iWRegister, boolean bSubtractionBit) { + public int calcAddition(int iValue1, int iWRegister, boolean bSubtractionBit) { //Array with booleans which represent the value of value 1 that will be used for calculation boolean[] abValue1 = new boolean[8]; abValue1[0] = ((iValue1 & 0b1) == 0b1); diff --git a/src/Model/Microcontroller/PIC.java b/src/Model/Microcontroller/PIC.java index b3523f7..78a6ced 100755 --- a/src/Model/Microcontroller/PIC.java +++ b/src/Model/Microcontroller/PIC.java @@ -127,7 +127,7 @@ public class PIC { */ public void ADDLW(int eightK) { int wRegValue = get_WRegister(); - int result = ArithmeticLogicUnit.calcValue(eightK, wRegValue, false); + int result = ArithmeticLogicUnit.calcAddition(eightK, wRegValue, false); result &= 255; setWRegister(result); @@ -197,7 +197,7 @@ public class PIC { int regFileAddrValue = Ram.get_Value_Of_Bank_RP0_Bit_Of_Element_At_Adress(Ram.get_RP0Bit(), registerFileAddress); //Calculate result. - int result = ArithmeticLogicUnit.calcValue(regFileAddrValue, wRegValue, false); + int result = ArithmeticLogicUnit.calcAddition(regFileAddrValue, wRegValue, false); Ram.set_Carryflag(ArithmeticLogicUnit.getCarryFlag()); Ram.set_Digitcarryflag(ArithmeticLogicUnit.getDigitCarryFlag()); @@ -1177,7 +1177,7 @@ public class PIC { public void SUBLW(int eightK) { int wRegValue = get_WRegister(); - int result = ArithmeticLogicUnit.calcValue(eightK, wRegValue, true); + int result = ArithmeticLogicUnit.calcAddition(eightK, wRegValue, true); result &= 255; Ram.set_Carryflag(ArithmeticLogicUnit.getCarryFlag()); @@ -1210,7 +1210,7 @@ public class PIC { //Get value at fileaddress. int regFileAddrValue = Ram.get_Value_Of_Bank_RP0_Bit_Of_Element_At_Adress(Ram.get_RP0Bit(), registerFileAddress); - int result = ArithmeticLogicUnit.calcValue(regFileAddrValue, wRegValue, true); + int result = ArithmeticLogicUnit.calcAddition(regFileAddrValue, wRegValue, true); result &= 255; Ram.set_Carryflag(ArithmeticLogicUnit.getCarryFlag()); diff --git a/src/View/GUIRamTable.java b/src/View/GUIRamTable.java index 2b17617..dd12f8e 100644 --- a/src/View/GUIRamTable.java +++ b/src/View/GUIRamTable.java @@ -33,7 +33,7 @@ public class GUIRamTable extends JScrollPane { JLabel oRam = new JLabel("RAM"); - String[][] assData = {{"0x", "07", "06", "05", "04", "03", "02", "01", "00"}, {"00", "", "", "", "", "", "", "", ""}, + String[][] assData = {{"0x", "00", "01", "02", "03", "04", "05", "06", "07"}, {"00", "", "", "", "", "", "", "", ""}, {"08", "", "", "", "", "", "", "", ""}, {"10", "", "", "", "", "", "", "", ""}, {"18", "", "", "", "", "", "", "", ""}, {"20", "", "", "", "", "", "", "", ""}, {"28", "", "", "", "", "", "", "", ""}, {"30", "", "", "", "", "", "", "", ""}, diff --git a/src/View/GUITestFileTable.java b/src/View/GUITestFileTable.java index 95e6f5c..d55e548 100644 --- a/src/View/GUITestFileTable.java +++ b/src/View/GUITestFileTable.java @@ -195,11 +195,13 @@ public class GUITestFileTable extends JScrollPane { * @param iLineToMark */ public void markLine(int iLineToMark) { - if (iLineToMark > -1) { - oLineInformation.get(iLineToMark * 2).setForeground(getThemeColor()[3]); - oLineInformation.get(iLineToMark * 2).setBorder(BorderFactory.createLineBorder(getThemeColor()[3])); - oLineInformation.get(iLineToMark * 2 + 1).setForeground(getThemeColor()[3]); - oLineInformation.get(iLineToMark * 2 + 1).setBorder(BorderFactory.createLineBorder(getThemeColor()[3])); + if (oLineInformation.size() > iLineToMark) { + if (iLineToMark > -1) { + oLineInformation.get(iLineToMark * 2).setForeground(getThemeColor()[3]); + oLineInformation.get(iLineToMark * 2).setBorder(BorderFactory.createLineBorder(getThemeColor()[3])); + oLineInformation.get(iLineToMark * 2 + 1).setForeground(getThemeColor()[3]); + oLineInformation.get(iLineToMark * 2 + 1).setBorder(BorderFactory.createLineBorder(getThemeColor()[3])); + } } } @@ -208,11 +210,13 @@ public class GUITestFileTable extends JScrollPane { * @param iLineToUnmark */ public void unmarkLine(int iLineToUnmark) { - if (iLineToUnmark > -1) { - oLineInformation.get(iLineToUnmark * 2).setForeground(getThemeColor()[0]); - oLineInformation.get(iLineToUnmark * 2).setBorder(BorderFactory.createLineBorder(getThemeColor()[2])); - oLineInformation.get(iLineToUnmark * 2 + 1).setForeground(getThemeColor()[0]); - oLineInformation.get(iLineToUnmark * 2 + 1).setBorder(BorderFactory.createLineBorder(getThemeColor()[2])); + if (oLineInformation.size() > iLineToUnmark) { + if (iLineToUnmark > -1) { + oLineInformation.get(iLineToUnmark * 2).setForeground(getThemeColor()[0]); + oLineInformation.get(iLineToUnmark * 2).setBorder(BorderFactory.createLineBorder(getThemeColor()[2])); + oLineInformation.get(iLineToUnmark * 2 + 1).setForeground(getThemeColor()[0]); + oLineInformation.get(iLineToUnmark * 2 + 1).setBorder(BorderFactory.createLineBorder(getThemeColor()[2])); + } } }