diff --git a/dist/C41C.jar b/dist/C41C.jar index 842f3f1..1cb4158 100644 Binary files a/dist/C41C.jar and b/dist/C41C.jar differ diff --git a/src/c41c/Window.java b/src/c41c/Window.java index 4ce0c19..9707f50 100644 --- a/src/c41c/Window.java +++ b/src/c41c/Window.java @@ -1197,30 +1197,11 @@ private void bitSwitch(JLabel bitLabel) { String bit = bitLabel.getText(); int bitPos = Integer.parseInt(bitLabel.getName()); - BigInteger value = BigInteger.ONE.shiftLeft(bitPos); - if(bit.equals("1")) { - if(!OperationUnderway) - Value = Value.subtract(value); - else { - if (!SecondOperandEntered) { - SecondOperator = BigInteger.ZERO; - SecondOperandEntered = true; - } - SecondOperator = SecondOperator.subtract(value); - } - bitLabel.setText("0"); - } else if(bit.equals("0")) { - if(!OperationUnderway) - Value = Value.add(value); - else { - if (!SecondOperandEntered) { - SecondOperator = BigInteger.ZERO; - SecondOperandEntered = true; - } - SecondOperator = SecondOperator.add(value); - } - bitLabel.setText("1"); - } + if(!OperationUnderway) + Value = Value.flipBit(bitPos); + else + SecondOperator = SecondOperator.flipBit(bitPos); + bitLabel.setText(bit.equals("1") ? "0" : "1"); //setSize(new java.awt.Dimension(386, 396)); refreshTextArea();