Implemented basic command detector
This commit is contained in:
@@ -58,6 +58,57 @@ public class CommandDecoder
|
|||||||
} else if ((binaryInput & 0x3F00) == 0x600)
|
} else if ((binaryInput & 0x3F00) == 0x600)
|
||||||
{
|
{
|
||||||
//XORWF();
|
//XORWF();
|
||||||
|
} else if ((binaryInput & 0xF000) == 0x4000)
|
||||||
|
{
|
||||||
|
//BCF
|
||||||
|
} else if ((binaryInput & 0xF000) == 0x5000)
|
||||||
|
{
|
||||||
|
//BSF
|
||||||
|
} else if ((binaryInput & 0xF000) == 0x6000)
|
||||||
|
{
|
||||||
|
//BTFSC
|
||||||
|
} else if ((binaryInput & 0xF000) == 0x7000)
|
||||||
|
{
|
||||||
|
//BTFSS
|
||||||
|
} else if ((binaryInput & 0x3E00) == 0x3E00)
|
||||||
|
{
|
||||||
|
//ADDLW
|
||||||
|
} else if ((binaryInput & 0x3F00) == 0x3900)
|
||||||
|
{
|
||||||
|
//ANDLW
|
||||||
|
} else if ((binaryInput & 0x3800) == 0x2000)
|
||||||
|
{
|
||||||
|
//CALL
|
||||||
|
} else if (binaryInput == 0x0064)
|
||||||
|
{
|
||||||
|
//Clear Watchdog Timer
|
||||||
|
} else if ((binaryInput & 0x3800) == 0x2800)
|
||||||
|
{
|
||||||
|
//GOTO
|
||||||
|
} else if ((binaryInput & 0x3F00) == 0x3800)
|
||||||
|
{
|
||||||
|
//IORLW
|
||||||
|
} else if ((binaryInput & 0x3C00) == 0x3000)
|
||||||
|
{
|
||||||
|
//MOVLW
|
||||||
|
} else if (binaryInput == 0x0009)
|
||||||
|
{
|
||||||
|
//RETFIE
|
||||||
|
} else if ((binaryInput & 0x3C00) == 0x3400)
|
||||||
|
{
|
||||||
|
//RETLW
|
||||||
|
} else if (binaryInput == 0x0008)
|
||||||
|
{
|
||||||
|
//RETURN
|
||||||
|
} else if (binaryInput == 0x0063)
|
||||||
|
{
|
||||||
|
//SLEEP
|
||||||
|
} else if ((binaryInput & 0x3E00) == 0x3C00)
|
||||||
|
{
|
||||||
|
//SUBLW
|
||||||
|
} else if ((binaryInput & 0x3F00) == 0x3A00)
|
||||||
|
{
|
||||||
|
//XORLW
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,11 +3,10 @@
|
|||||||
class HelloWorld {
|
class HelloWorld {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
System.out.println("Hello, World!");
|
System.out.println("Hello, World!");
|
||||||
String input = "1962";
|
String input = "9";
|
||||||
//String input = "12032";
|
CommandDecoder commandDecoder = new CommandDecoder();
|
||||||
|
commandDecoder.CommandDecoder(input);
|
||||||
int binaryInput = Integer.parseInt(input);
|
int binaryInput = Integer.parseInt(input);
|
||||||
System.out.println(binaryInput);
|
System.out.println(binaryInput);
|
||||||
Boolean test = (binaryInput & 0x3F00) == 0x700;
|
|
||||||
System.out.println(test);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user