summaryrefslogtreecommitdiff
path: root/isa/decode.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--isa/decode.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/isa/decode.cpp b/isa/decode.cpp
index 6ea3bb5..6ab90fd 100644
--- a/isa/decode.cpp
+++ b/isa/decode.cpp
@@ -6,13 +6,17 @@
6 6
7instruction_context decode(std::uint_fast32_t flags, unsigned int pc, unsigned int bits, bool interrupt) 7instruction_context decode(std::uint_fast32_t flags, unsigned int pc, unsigned int bits, bool interrupt)
8{ 8{
9 //bool gt = (flags >> 10) & 1; 9#pragma GCC diagnostic push
10#pragma GCC diagnostic ignored "-Wunused-variable"
11 bool ied = (flags >> 12) & 1;
12 bool gt = (flags >> 10) & 1;
10 bool ir = (flags >> 9) & 1; 13 bool ir = (flags >> 9) & 1;
11 //bool ii = (flags >> 8) & 1; 14 bool ii = (flags >> 8) & 1;
12 bool ie = (flags >> 7) & 1; 15 bool ie = (flags >> 7) & 1;
13 //bool u = (flags >> 6) & 1; 16 bool u = (flags >> 6) & 1;
14 bool ifb = (flags >> 3) & 7; 17 bool ifb = (flags >> 3) & 7;
15 bool df = flags & 7; 18 bool df = flags & 7;
19#pragma GCC diagnostic pop
16 20
17 instruction_context inst; 21 instruction_context inst;
18 inst.next_pc = (pc & ~07777) | ((pc + 1) & 07777); 22 inst.next_pc = (pc & ~07777) | ((pc + 1) & 07777);
@@ -283,6 +287,15 @@ instruction_context decode(std::uint_fast32_t flags, unsigned int pc, unsigned i
283 ctx.ctlval = (flags & ~FLAG_DF) | (field << FLAG_DF_SHIFT); 287 ctx.ctlval = (flags & ~FLAG_DF) | (field << FLAG_DF_SHIFT);
284 }; 288 };
285 break; 289 break;
290 case 04:
291 // RMF restore memory field
292 inst.read_ctlreg = FLAGS_SAVED;
293 inst.write_ctlreg = FLAGS;
294 inst.ef = [flags](auto &ctx) {
295 ctx.ctlval.value() &= FLAG_DF | FLAG_IF | FLAG_USER_MODE;
296 ctx.ctlval.value() |= flags & ~(FLAG_DF | FLAG_IF | FLAG_USER_MODE);
297 };
298 break;
286 default: 299 default:
287 inst.ef = [bits, field](auto &ctx) { 300 inst.ef = [bits, field](auto &ctx) {
288 std::cerr << "unimplemented IOT MEMORY suboperation " << (bits & 07) << " upon field " << field << "\n"; 301 std::cerr << "unimplemented IOT MEMORY suboperation " << (bits & 07) << " upon field " << field << "\n";