aboutsummaryrefslogtreecommitdiff
path: root/lib/vnf/src
diff options
context:
space:
mode:
Diffstat (limited to 'lib/vnf/src')
-rw-r--r--lib/vnf/src/lib.rs15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/vnf/src/lib.rs b/lib/vnf/src/lib.rs
index e2d066b..ab8973b 100644
--- a/lib/vnf/src/lib.rs
+++ b/lib/vnf/src/lib.rs
@@ -771,10 +771,6 @@ impl Machine {
self.status_register.overflow = false;
match self.current_instruction.identifier {
- // TODO
- InstructionIdentifier::Bvc => todo!(),
- InstructionIdentifier::Bvs => todo!(),
-
// Flag instructions.
InstructionIdentifier::Sec => self.status_register.carry = true,
InstructionIdentifier::Clc => self.status_register.carry = false,
@@ -1042,6 +1038,17 @@ impl Machine {
self.branch();
}
}
+ InstructionIdentifier::Bvc => {
+ if !self.status_register.overflow {
+ self.branch();
+ }
+ }
+ InstructionIdentifier::Bvs => {
+ if self.status_register.overflow {
+ self.branch();
+ }
+ }
+
InstructionIdentifier::Rts => {
// If the stack is empty but we were just running a function,
// then assume that the machine is done.