From 82c461307eba25265867f233a27060621ac6cba4 Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Mon, 31 Oct 2022 19:03:38 -0700 Subject: TAD is 12-bit addition with carry-complements-link, not 13-bit addition --- isa/decode.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'isa/decode.cpp') 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 inst.need_write_acc = true; inst.need_write_link = true; inst.ef = [](auto &ctx) { - unsigned int sum = (ctx.link.value() << 12) + ctx.acc.value() + ctx.data.value(); - ctx.link = (sum >> 12) & 1; + unsigned int sum = ctx.acc.value() + ctx.data.value(); + ctx.link = ctx.link.value() ^ (sum >> 12); ctx.acc = sum & 07777; }; break; -- cgit v1.2.3