summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Blake Kongslie2022-10-31 19:26:15 -0700
committerJulian Blake Kongslie2022-10-31 19:26:15 -0700
commit683d2d10afcee0d728794cc179f640e8a777b3c1 (patch)
treee23dc9a4ebc841782b6d34d12e47864020321a2d
parentOnly use DF for addresses generated via indirection. (diff)
downloadbiggolf-683d2d10afcee0d728794cc179f640e8a777b3c1.tar.xz
Unify TT_INPUT_INT_ENABLE and TT_OUTPUT_INT_ENABLE
Diffstat (limited to '')
-rw-r--r--io/model.cpp4
-rw-r--r--isa/ctlreg.def3
-rw-r--r--isa/decode.cpp4
3 files changed, 5 insertions, 6 deletions
diff --git a/io/model.cpp b/io/model.cpp
index e9caba0..3bea59e 100644
--- a/io/model.cpp
+++ b/io/model.cpp
@@ -24,11 +24,11 @@ bool iomodel::interact(std::array<std::uint_fast32_t, NUM_CTLREGS> &ctlregs) {
24 } 24 }
25 25
26 bool interrupt = false; 26 bool interrupt = false;
27 if (ctlregs[TT_INPUT_INT_ENABLE]) { 27 if (ctlregs[TT_INT_ENABLE]) {
28 if (ctlregs[TT_BITS] & TTI_FLAG) 28 if (ctlregs[TT_BITS] & TTI_FLAG)
29 interrupt = true; 29 interrupt = true;
30 } 30 }
31 if (ctlregs[TT_OUTPUT_INT_ENABLE]) { 31 if (ctlregs[TT_INT_ENABLE]) {
32 if ((ctlregs[TT_BITS] & (TTO_FLAG|TTO_FLAG_OLD)) == TTO_FLAG) 32 if ((ctlregs[TT_BITS] & (TTO_FLAG|TTO_FLAG_OLD)) == TTO_FLAG)
33 interrupt = true; 33 interrupt = true;
34 } 34 }
diff --git a/isa/ctlreg.def b/isa/ctlreg.def
index c9eab05..d490073 100644
--- a/isa/ctlreg.def
+++ b/isa/ctlreg.def
@@ -4,5 +4,4 @@ REG(HALTED)
4REG(INT_ENABLE) // (int_enable_delay << 1) | int_enable 4REG(INT_ENABLE) // (int_enable_delay << 1) | int_enable
5REG(INT_PENDING) // only meaningful if interrupts disabled 5REG(INT_PENDING) // only meaningful if interrupts disabled
6REG(TT_BITS) // see TT[IO]_* consts in isa/isa.h 6REG(TT_BITS) // see TT[IO]_* consts in isa/isa.h
7REG(TT_INPUT_INT_ENABLE) // (status_enable << 1) | (int_enable) 7REG(TT_INT_ENABLE) // (status_enable << 1) | (int_enable)
8REG(TT_OUTPUT_INT_ENABLE)
diff --git a/isa/decode.cpp b/isa/decode.cpp
index f183c1f..c11679c 100644
--- a/isa/decode.cpp
+++ b/isa/decode.cpp
@@ -153,9 +153,9 @@ instruction_context decode(unsigned int dfifb, unsigned int pc, unsigned int bit
153 }; 153 };
154 break; 154 break;
155 case 5: 155 case 5:
156 // KIE set TT_INPUT_INT_ENABLE to the low bit of the accumulator 156 // KIE set TT_INT_ENABLE to the low bit of the accumulator
157 inst.need_read_acc = true; 157 inst.need_read_acc = true;
158 inst.write_ctlreg = TT_INPUT_INT_ENABLE; 158 inst.write_ctlreg = TT_INT_ENABLE;
159 inst.ef = [](auto &ctx) { 159 inst.ef = [](auto &ctx) {
160 ctx.ctlval = ctx.acc.value() & 3; 160 ctx.ctlval = ctx.acc.value() & 3;
161 }; 161 };