summaryrefslogtreecommitdiff
path: root/isa
diff options
context:
space:
mode:
authorJulian Blake Kongslie2022-10-17 17:55:21 -0700
committerJulian Blake Kongslie2022-10-17 17:55:21 -0700
commit94330e8cb98249162594e6febbe8f92cca87e775 (patch)
treef4fec3250ae272ab83612585e380532fdc146088 /isa
parentClean up address handling and change autoinc to preincrement (diff)
downloadbiggolf-94330e8cb98249162594e6febbe8f92cca87e775.tar.xz
Fix rotate left to not drop the highest bit
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 03e2225..dde5b74 100644
--- a/isa/decode.cpp
+++ b/isa/decode.cpp
@@ -168,9 +168,9 @@ instruction_context decode(unsigned int dfifb, unsigned int pc, unsigned int bit
168 } 168 }
169 if (ral && !rar) { 169 if (ral && !rar) {
170 unsigned int x = (ctx.link.value() << 12) | ctx.acc.value(); 170 unsigned int x = (ctx.link.value() << 12) | ctx.acc.value();
171 x = ((x << 1) & 07777) | (x >> 12); 171 x = ((x << 1) & 017777) | (x >> 12);
172 if (bsw) 172 if (bsw)
173 x = ((x << 1) & 07777) | (x >> 12); 173 x = ((x << 1) & 017777) | (x >> 12);
174 ctx.link = x >> 12; 174 ctx.link = x >> 12;
175 ctx.acc = x & 07777; 175 ctx.acc = x & 07777;
176 } 176 }