implemented Xorlw Instruction

This commit is contained in:
Darkress
2023-05-29 03:09:14 +02:00
parent 769c37e5f3
commit 0d1db917c0
2 changed files with 27 additions and 0 deletions

View 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;
}
}

View File

@@ -15,4 +15,9 @@ public class ProgramCounter
{
ProgramCounter.PC = PC;
}
public static void incPC()
{
PC++;
}
}