From 46515de5f19fed727d8798fad78c09c8f522579e Mon Sep 17 00:00:00 2001 From: darkress <30271678+darkressx@users.noreply.github.com> Date: Wed, 31 May 2023 20:24:57 +0200 Subject: [PATCH] implemented Nop Instruction (#11) Co-authored-by: Darkress <30271678+DarkressX@users.noreply.github.com> Reviewed-on: https://git.darkress.xyz/darkress/pic16f84-sim/pulls/11 --- de/darkress/pic16f84sim/commands/Nop.java | 14 ++++++++++++++ .../pic16f84sim/decoder/CommandDecoder.java | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 de/darkress/pic16f84sim/commands/Nop.java diff --git a/de/darkress/pic16f84sim/commands/Nop.java b/de/darkress/pic16f84sim/commands/Nop.java new file mode 100644 index 0000000..ef3c182 --- /dev/null +++ b/de/darkress/pic16f84sim/commands/Nop.java @@ -0,0 +1,14 @@ +package de.darkress.pic16f84sim.commands; + +import de.darkress.pic16f84sim.microcontroller.ProgramCounter; + +public class Nop extends LiteralCommandUtils implements Command +{ + + @Override + public void execute() + { + // Do nothing, just increment the PC + ProgramCounter.incPC(); + } +} diff --git a/de/darkress/pic16f84sim/decoder/CommandDecoder.java b/de/darkress/pic16f84sim/decoder/CommandDecoder.java index c7f1954..f756150 100644 --- a/de/darkress/pic16f84sim/decoder/CommandDecoder.java +++ b/de/darkress/pic16f84sim/decoder/CommandDecoder.java @@ -111,7 +111,7 @@ public class CommandDecoder if ((input | 0x0060) == 0x0060) { - //nop(); + return new Nop(); } if (input == 0x0064)