summaryrefslogtreecommitdiff
path: root/isa/decode.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--isa/decode.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/isa/decode.cpp b/isa/decode.cpp
index 9563327..c35118b 100644
--- a/isa/decode.cpp
+++ b/isa/decode.cpp
@@ -152,6 +152,24 @@ instruction_context decode(unsigned int dfifb, unsigned int pc, unsigned int bit
152 ctx.next_pc = (ctx.next_pc & ~07777) | ((ctx.next_pc + 1) & 07777); 152 ctx.next_pc = (ctx.next_pc & ~07777) | ((ctx.next_pc + 1) & 07777);
153 }; 153 };
154 break; 154 break;
155 case 5:
156 // KIE set TT_INPUT_INT_ENABLE to the low bit of the accumulator
157 inst.need_read_acc = true;
158 inst.write_ctlreg = TT_INPUT_INT_ENABLE;
159 inst.ef = [](auto &ctx) {
160 ctx.ctlval = ctx.acc.value() & 3;
161 };
162 break;
163 case 6:
164 // KRB transfer keyboard buffer to accumulator and clear TTI flag
165 inst.read_ctlreg = TT_BITS;
166 inst.need_write_acc = true;
167 inst.write_ctlreg = TT_BITS;
168 inst.ef = [](auto &ctx) {
169 ctx.acc = (ctx.ctlval.value() & TTI_DATA) >> TTI_DATA_SHIFT;
170 ctx.ctlval.value() &= ~TTI_FLAG;
171 };
172 break;
155 default: 173 default:
156 inst.ef = [bits](auto &ctx) { 174 inst.ef = [bits](auto &ctx) {
157 std::cerr << "unimplemented IOT KB suboperation " << (bits & 07) << "\n"; 175 std::cerr << "unimplemented IOT KB suboperation " << (bits & 07) << "\n";
@@ -194,7 +212,7 @@ instruction_context decode(unsigned int dfifb, unsigned int pc, unsigned int bit
194 inst.write_ctlreg = TT_BITS; 212 inst.write_ctlreg = TT_BITS;
195 inst.ef = [](auto &ctx) { 213 inst.ef = [](auto &ctx) {
196 auto &x = ctx.ctlval.value(); 214 auto &x = ctx.ctlval.value();
197 auto chr = ctx.acc.value() ^ 0x80; 215 auto chr = ctx.acc.value();
198 x &= ~TTO_DATA; 216 x &= ~TTO_DATA;
199 x |= (chr << TTO_DATA_SHIFT) & TTO_DATA; 217 x |= (chr << TTO_DATA_SHIFT) & TTO_DATA;
200 x |= TTO_TX; 218 x |= TTO_TX;
@@ -216,7 +234,7 @@ instruction_context decode(unsigned int dfifb, unsigned int pc, unsigned int bit
216 inst.write_ctlreg = TT_BITS; 234 inst.write_ctlreg = TT_BITS;
217 inst.ef = [](auto &ctx) { 235 inst.ef = [](auto &ctx) {
218 auto &x = ctx.ctlval.value(); 236 auto &x = ctx.ctlval.value();
219 auto chr = ctx.acc.value() ^ 0x80; 237 auto chr = ctx.acc.value();
220 x &= ~TTO_FLAG & ~TTO_FLAG_OLD & ~TTO_DATA; 238 x &= ~TTO_FLAG & ~TTO_FLAG_OLD & ~TTO_DATA;
221 x |= (chr << TTO_DATA_SHIFT) & TTO_DATA; 239 x |= (chr << TTO_DATA_SHIFT) & TTO_DATA;
222 x |= TTO_TX; 240 x |= TTO_TX;