No-Flags
This commit is contained in:
@ -40,7 +40,7 @@ public class Commands {
|
|||||||
return;
|
return;
|
||||||
case 0b01010000000000:
|
case 0b01010000000000:
|
||||||
System.out.println("BSF: " + f + " " + b);
|
System.out.println("BSF: " + f + " " + b);
|
||||||
DataRegister.clearBit(f, b);
|
DataRegister.setBit(f, b);
|
||||||
return;
|
return;
|
||||||
case 0b01100000000000:
|
case 0b01100000000000:
|
||||||
System.out.println("BTFSC: " + f + " " + b);
|
System.out.println("BTFSC: " + f + " " + b);
|
||||||
|
|||||||
@ -48,7 +48,6 @@ public class Controller_FileSelect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getProg() {
|
public int[] getProg() {
|
||||||
return prog;
|
return prog;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,12 +48,16 @@ public class DataRegister {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void clearBit(int address, int bit) {
|
public static void clearBit(int address, int bit) {
|
||||||
|
if (getBit(address, bit) == 1) {
|
||||||
dataRegister[bank() + address] -= (int) Math.pow(2, bit);
|
dataRegister[bank() + address] -= (int) Math.pow(2, bit);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void setBit(int address, int bit) {
|
public static void setBit(int address, int bit) {
|
||||||
|
if (getBit(address, bit) == 0) {
|
||||||
dataRegister[bank() + address] += (int) Math.pow(2, bit);
|
dataRegister[bank() + address] += (int) Math.pow(2, bit);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static int programCounter = 0;
|
private static int programCounter = 0;
|
||||||
|
|
||||||
@ -81,5 +85,4 @@ public class DataRegister {
|
|||||||
public static int getPC(){
|
public static int getPC(){
|
||||||
return programCounter;
|
return programCounter;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user