implemented Goto Instruction; Increment ProgramCounter; (#2)
Co-authored-by: Darkress <30271678+DarkressX@users.noreply.github.com> Reviewed-on: darkress/pic16f84-sim#2
This commit was merged in pull request #2.
This commit is contained in:
20
de/darkress/pic16f84sim/commands/Goto.java
Normal file
20
de/darkress/pic16f84sim/commands/Goto.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package de.darkress.pic16f84sim.commands;
|
||||
|
||||
import de.darkress.pic16f84sim.microcontroller.Memory;
|
||||
import de.darkress.pic16f84sim.microcontroller.ProgramCounter;
|
||||
|
||||
public class Goto extends CommandUtils implements Command
|
||||
{
|
||||
private final int literal;
|
||||
|
||||
public Goto(int input)
|
||||
{
|
||||
literal = input & 0x07FF;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute()
|
||||
{
|
||||
ProgramCounter.setPcForGotoCall(literal);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user