summaryrefslogtreecommitdiff
path: root/isa/decode.cpp
diff options
context:
space:
mode:
authorJulian Blake Kongslie2022-10-31 19:03:38 -0700
committerJulian Blake Kongslie2022-10-31 19:03:38 -0700
commit82c461307eba25265867f233a27060621ac6cba4 (patch)
treedc6d0bb8ce85b1861146abf13183140e45476c23 /isa/decode.cpp
parentFix echo_optimal (was not resetting AC on all loop iterations) (diff)
downloadbiggolf-82c461307eba25265867f233a27060621ac6cba4.tar.xz
TAD is 12-bit addition with carry-complements-link, not 13-bit addition
Diffstat (limited to '')
-rw-r--r--isa/decode.cpp4
1 files changed, 2 insertions, 2 deletions
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;