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