diff --git a/commands/Movlw.java b/commands/Movlw.java new file mode 100644 index 0000000..38233cd --- /dev/null +++ b/commands/Movlw.java @@ -0,0 +1,19 @@ +package commands; + +import registers.Memory; + +public class Movlw extends CommandUtils implements Command +{ + private final int literal; + + public Movlw(int input) + { + literal = input & 0x00FF; + } + + @Override + public void execute() + { + Memory.workingRegister = literal; + } +} diff --git a/decoder/CommandDecoder.java b/decoder/CommandDecoder.java index f95ee74..6a30093 100644 --- a/decoder/CommandDecoder.java +++ b/decoder/CommandDecoder.java @@ -1,9 +1,6 @@ package decoder; -import commands.Addlw; -import commands.Andlw; -import commands.Command; -import commands.Iorlw; +import commands.*; public class CommandDecoder { @@ -115,8 +112,7 @@ public class CommandDecoder switch(input & 0x3C00) { case 0x3000: - //movlw(); - break; + return new Movlw(input); case 0x3400: //retlw(); break;