From 3b338043270c561e6cbbd93d8eb31d36af5e43bf Mon Sep 17 00:00:00 2001 From: Mark Emmer Date: Thu, 5 Feb 2015 17:42:04 -0600 Subject: [PATCH] SDS: Fix overflow test instructions OVT and OTO Improper implementation of the OVT and OTO instructions. OV is always zero or one, so the Boolean AND in the original if statement would always fail. Also, these instructions are supposed to skip if overflow is not set, the opposite of the way it was coded. --- SDS/sds_cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SDS/sds_cpu.c b/SDS/sds_cpu.c index 798a534a..665d65c0 100644 --- a/SDS/sds_cpu.c +++ b/SDS/sds_cpu.c @@ -969,7 +969,7 @@ switch (op) { /* case on opcode */ /* Overflow instruction */ case OVF: - if ((inst & 0100) & OV) + if ((inst & 0100) && !OV) P = (P + 1) & VA_MASK; if (inst & 0001) OV = 0;