Command-Erkennung

This commit is contained in:
2024-04-18 14:29:50 +02:00
parent 2e5fedaa3a
commit c2f5c3a81a
5 changed files with 203 additions and 3 deletions

View File

@ -0,0 +1,36 @@
package fabrik.simulator.pic16f84;
import java.util.Arrays;
public class DataRegister {
private static int [] dataRegister = new int[0xFF];
public static void initDataRegister() {
dataRegister[0x2] = 0b0;
dataRegister[0x3] = 0b00011000;
dataRegister[0xA] = 0b0;
dataRegister[0xB] = 0b0;
dataRegister[0x81] = 0b11111111;
dataRegister[0x82] = 0b0;
dataRegister[0x83] = 0b00011000;
dataRegister[0x85] = 0b11111000;
dataRegister[0x86] = 0b11111111;
dataRegister[0x88] = 0b0;
dataRegister[0x8A] = 0b0;
dataRegister[0x8B] = 0b0;
System.out.println(Arrays.toString(dataRegister));
}
public static int[] getDataRegister() {
return dataRegister;
}
public static int getBit(int address, int bit) {
return (dataRegister[address] >> bit) & 1;
}
}