Add Movlw instruction (#7)
This commit is contained in:
19
commands/Movlw.java
Normal file
19
commands/Movlw.java
Normal file
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,9 +1,6 @@
|
|||||||
package decoder;
|
package decoder;
|
||||||
|
|
||||||
import commands.Addlw;
|
import commands.*;
|
||||||
import commands.Andlw;
|
|
||||||
import commands.Command;
|
|
||||||
import commands.Iorlw;
|
|
||||||
|
|
||||||
public class CommandDecoder
|
public class CommandDecoder
|
||||||
{
|
{
|
||||||
@@ -115,8 +112,7 @@ public class CommandDecoder
|
|||||||
switch(input & 0x3C00)
|
switch(input & 0x3C00)
|
||||||
{
|
{
|
||||||
case 0x3000:
|
case 0x3000:
|
||||||
//movlw();
|
return new Movlw(input);
|
||||||
break;
|
|
||||||
case 0x3400:
|
case 0x3400:
|
||||||
//retlw();
|
//retlw();
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user