From 763beb022c799598ef4eaa9750ad259497bd2e84 Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Sat, 22 Oct 2022 22:53:26 -0700 Subject: Merge TT_INPUT and TT_OUTPUT into TT_BITS --- isa/isa.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'isa/isa.h') diff --git a/isa/isa.h b/isa/isa.h index bea484e..24ed108 100644 --- a/isa/isa.h +++ b/isa/isa.h @@ -8,14 +8,23 @@ enum ctlreg { DATA_INSTRUCTION_FIELD_SAVED, // (df_saved << 3) | if_saved HALTED, INT_ENABLE, // (int_enable_delay << 1) | int_enable - TT_INPUT, // (tti_flag << 8) | tti_buffer + TT_BITS, // see below TT[IO]_* consts TT_INPUT_INT_ENABLE, - TT_OUTPUT, // {tto_flag_old, tto_flag, tto_tx, tto_data} TT_OUTPUT_INT_ENABLE, NUM_CTLREGS, }; +// 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 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; + struct instruction_context { // Known statically at decode time bool need_indirect_load = false; // final_address = mem[init_address] -- cgit v1.2.3