XorlwInstruction #1

Merged
Darkress merged 2 commits from XorlwInstruction into main 2023-05-29 15:39:04 +02:00
2 changed files with 27 additions and 0 deletions
Showing only changes of commit 0d1db917c0 - Show all commits

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