From 9f4aa97822adc791f700670ef0fc7636849563b7 Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Sat, 29 Oct 2022 18:18:26 -0700 Subject: Understanding interrupt handling within SIMH (see echo_int.pal) Add list of Bugs Add event log file parser More changes associated with widening the ctlregs (FIXME add a typedef) Add some keyboard instructions --- isa/isa.h | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) (limited to 'isa/isa.h') diff --git a/isa/isa.h b/isa/isa.h index 84a783c..6484cd8 100644 --- a/isa/isa.h +++ b/isa/isa.h @@ -2,30 +2,39 @@ #include #include +#include #include +#include enum ctlreg { - DATA_INSTRUCTION_FIELD_BUFFER, // (df << 3) | if_buffer - DATA_INSTRUCTION_FIELD_SAVED, // (df_saved << 3) | if_saved - HALTED, - INT_ENABLE, // (int_enable_delay << 1) | int_enable - INT_PENDING, // only meaningful if interrupts disabled - TT_BITS, // see below TT[IO]_* consts - TT_INPUT_INT_ENABLE, - TT_OUTPUT_INT_ENABLE, +#define REG(N) N, +#include "ctlreg.def" +#undef REG NUM_CTLREGS, }; +const char * const ctlreg_names[] = { +#define REG(N) #N, +#include "ctlreg.def" +#undef REG +}; + +const std::map ctlreg_map = { +#define REG(N) { #N, N }, +#include "ctlreg.def" +#undef REG +}; + // TT_BITS -static constexpr unsigned int TTI_FLAG = 1 << 0; -static constexpr unsigned int TTO_TX = 1 << 1; -static constexpr unsigned int TTO_FLAG = 1 << 2; -static constexpr unsigned int TTO_FLAG_OLD = 1 << 3; +static constexpr std::uint_fast32_t TTI_FLAG = 1 << 0; +static constexpr std::uint_fast32_t TTO_TX = 1 << 1; +static constexpr std::uint_fast32_t TTO_FLAG = 1 << 2; +static constexpr std::uint_fast32_t TTO_FLAG_OLD = 1 << 3; static constexpr unsigned int TTI_DATA_SHIFT = 8; static constexpr unsigned int TTO_DATA_SHIFT = 16; -static constexpr unsigned int TTI_DATA = 0xff << TTI_DATA_SHIFT; -static constexpr unsigned int TTO_DATA = 0xff << TTO_DATA_SHIFT; +static constexpr std::uint_fast32_t TTI_DATA = 0xff << TTI_DATA_SHIFT; +static constexpr std::uint_fast32_t TTO_DATA = 0xff << TTO_DATA_SHIFT; struct instruction_context { // Known statically at decode time -- cgit v1.2.3