Added Iorlw Instrction (#6)
This commit is contained in:
22
commands/Iorlw.java
Normal file
22
commands/Iorlw.java
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
package commands;
|
||||||
|
|
||||||
|
import registers.Memory;
|
||||||
|
|
||||||
|
public class Iorlw extends CommandUtils implements Command
|
||||||
|
{
|
||||||
|
private final int literal;
|
||||||
|
|
||||||
|
public Iorlw(int input)
|
||||||
|
{
|
||||||
|
literal = input & 0x00FF;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void execute()
|
||||||
|
{
|
||||||
|
int result = literal | Memory.workingRegister;
|
||||||
|
|
||||||
|
checkZeroBit(result);
|
||||||
|
|
||||||
|
Memory.workingRegister = result % 256;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ package decoder;
|
|||||||
import commands.Addlw;
|
import commands.Addlw;
|
||||||
import commands.Andlw;
|
import commands.Andlw;
|
||||||
import commands.Command;
|
import commands.Command;
|
||||||
|
import commands.Iorlw;
|
||||||
|
|
||||||
public class CommandDecoder
|
public class CommandDecoder
|
||||||
{
|
{
|
||||||
@@ -55,8 +56,7 @@ public class CommandDecoder
|
|||||||
case 0x3900:
|
case 0x3900:
|
||||||
return new Andlw(input);
|
return new Andlw(input);
|
||||||
case 0x3800:
|
case 0x3800:
|
||||||
//iorlw();
|
return new Iorlw(input);
|
||||||
break;
|
|
||||||
case 0x3A00:
|
case 0x3A00:
|
||||||
//xorlw();
|
//xorlw();
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user