diff --git a/commands/Iorlw.java b/commands/Iorlw.java new file mode 100644 index 0000000..2522319 --- /dev/null +++ b/commands/Iorlw.java @@ -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; + } +} diff --git a/decoder/CommandDecoder.java b/decoder/CommandDecoder.java index e22ebe8..f95ee74 100644 --- a/decoder/CommandDecoder.java +++ b/decoder/CommandDecoder.java @@ -3,6 +3,7 @@ package decoder; import commands.Addlw; import commands.Andlw; import commands.Command; +import commands.Iorlw; public class CommandDecoder { @@ -55,8 +56,7 @@ public class CommandDecoder case 0x3900: return new Andlw(input); case 0x3800: - //iorlw(); - break; + return new Iorlw(input); case 0x3A00: //xorlw(); break;