summaryrefslogtreecommitdiff
path: root/isa/decode.cpp
diff options
context:
space:
mode:
authorJulian Blake Kongslie2022-10-29 12:55:08 -0700
committerJulian Blake Kongslie2022-10-29 13:14:13 -0700
commitff66523bb076a246c2fc159f0f76947bd6f84fc1 (patch)
tree63dbffc8be3c41eb5ec2f74dd7919f5f34a25a53 /isa/decode.cpp
parentAdd untested interrupt-based echo program with input buffer (diff)
downloadbiggolf-ff66523bb076a246c2fc159f0f76947bd6f84fc1.tar.xz
Control register values should not be "unsigned int"
Diffstat (limited to '')
-rw-r--r--isa/decode.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/isa/decode.cpp b/isa/decode.cpp
index 4af9a0d..9563327 100644
--- a/isa/decode.cpp
+++ b/isa/decode.cpp
@@ -140,6 +140,25 @@ instruction_context decode(unsigned int dfifb, unsigned int pc, unsigned int bit
140 break; 140 break;
141 } 141 }
142 break; 142 break;
143 case 003:
144 // KEYBOARD
145 switch (bits & 07) {
146 case 1:
147 // KSF skip if TTI flag is set
148 inst.read_ctlreg = TT_BITS;
149 inst.possibly_redirects = true;
150 inst.ef = [](auto &ctx) {
151 if (ctx.ctlval.value() & TTI_FLAG)
152 ctx.next_pc = (ctx.next_pc & ~07777) | ((ctx.next_pc + 1) & 07777);
153 };
154 break;
155 default:
156 inst.ef = [bits](auto &ctx) {
157 std::cerr << "unimplemented IOT KB suboperation " << (bits & 07) << "\n";
158 assert(false);
159 };
160 }
161 break;
143 case 004: 162 case 004:
144 // TELETYPE TELEPRINTER/PUNCH 163 // TELETYPE TELEPRINTER/PUNCH
145 switch (bits & 07) { 164 switch (bits & 07) {