implemented Xorlw Instruction
This commit is contained in:
22
de/darkress/pic16f84sim/commands/Xorlw.java
Normal file
22
de/darkress/pic16f84sim/commands/Xorlw.java
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
package de.darkress.pic16f84sim.commands;
|
||||||
|
|
||||||
|
import de.darkress.pic16f84sim.microcontroller.Memory;
|
||||||
|
|
||||||
|
public class Xorlw extends CommandUtils implements Command
|
||||||
|
{
|
||||||
|
private final int literal;
|
||||||
|
|
||||||
|
public Xorlw(int input)
|
||||||
|
{
|
||||||
|
literal = input & 0x00FF;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void execute()
|
||||||
|
{
|
||||||
|
int result = literal ^ Memory.workingRegister;
|
||||||
|
|
||||||
|
checkZeroBit(result);
|
||||||
|
|
||||||
|
Memory.workingRegister = result % 256;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,4 +15,9 @@ public class ProgramCounter
|
|||||||
{
|
{
|
||||||
ProgramCounter.PC = PC;
|
ProgramCounter.PC = PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void incPC()
|
||||||
|
{
|
||||||
|
PC++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user