summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Bugs1
-rw-r--r--isa/decode.cpp4
2 files changed, 2 insertions, 3 deletions
diff --git a/Bugs b/Bugs
index 2681d88..a4a5ad9 100644
--- a/Bugs
+++ b/Bugs
@@ -1,2 +1 @@
1TAD should do AC+[mem] and invert the link bit if the result carries
2IF is used for same-page and zero-page memory accesses (including the first access of an indirect) IF is used for same-page and zero-page memory accesses (including the first access of an indirect)
diff --git a/isa/decode.cpp b/isa/decode.cpp
index c35118b..af38c64 100644
--- a/isa/decode.cpp
+++ b/isa/decode.cpp
@@ -34,8 +34,8 @@ instruction_context decode(unsigned int dfifb, unsigned int pc, unsigned int bit
34 inst.need_write_acc = true; 34 inst.need_write_acc = true;
35 inst.need_write_link = true; 35 inst.need_write_link = true;
36 inst.ef = [](auto &ctx) { 36 inst.ef = [](auto &ctx) {
37 unsigned int sum = (ctx.link.value() << 12) + ctx.acc.value() + ctx.data.value(); 37 unsigned int sum = ctx.acc.value() + ctx.data.value();
38 ctx.link = (sum >> 12) & 1; 38 ctx.link = ctx.link.value() ^ (sum >> 12);
39 ctx.acc = sum & 07777; 39 ctx.acc = sum & 07777;
40 }; 40 };
41 break; 41 break;