diff options
Diffstat (limited to '')
| -rw-r--r-- | isa/isa.h | 20 |
1 files changed, 18 insertions, 2 deletions
| @@ -26,15 +26,31 @@ const std::map<std::string, ctlreg> ctlreg_map = { | |||
| 26 | #undef REG | 26 | #undef REG |
| 27 | }; | 27 | }; |
| 28 | 28 | ||
| 29 | // FLAGS and FLAGS_SAVED | ||
| 30 | static constexpr unsigned int FLAG_DF_SHIFT = 0; | ||
| 31 | static constexpr std::uint_fast32_t FLAG_DF = 07 << FLAG_DF_SHIFT; | ||
| 32 | static constexpr unsigned int FLAG_IF_SHIFT = 3; | ||
| 33 | static constexpr std::uint_fast32_t FLAG_IF = 07 << FLAG_IF_SHIFT; // In FLAGS this is IFB, not IF | ||
| 34 | static constexpr std::uint_fast32_t FLAG_USER_MODE = 1 << 6; | ||
| 35 | static constexpr std::uint_fast32_t FLAG_INT_ENABLE = 1 << 7; | ||
| 36 | static constexpr std::uint_fast32_t FLAG_INT_INHIBIT = 1 << 8; | ||
| 37 | static constexpr std::uint_fast32_t FLAG_INT_REQUEST = 1 << 9; | ||
| 38 | static constexpr std::uint_fast32_t FLAG_GREATER_THAN = 1 << 10; | ||
| 39 | static constexpr std::uint_fast32_t FLAG_INT_ENABLE_DELAY = 1 << 12; | ||
| 40 | |||
| 29 | // TT_BITS | 41 | // TT_BITS |
| 30 | static constexpr std::uint_fast32_t TTI_FLAG = 1 << 0; | 42 | static constexpr std::uint_fast32_t TTI_FLAG = 1 << 0; |
| 31 | static constexpr std::uint_fast32_t TTO_TX = 1 << 1; | 43 | static constexpr std::uint_fast32_t TTO_TX = 1 << 1; |
| 32 | static constexpr std::uint_fast32_t TTO_FLAG = 1 << 2; | 44 | static constexpr std::uint_fast32_t TTO_FLAG = 1 << 2; |
| 33 | static constexpr unsigned int TTI_DATA_SHIFT = 8; | 45 | static constexpr unsigned int TTI_DATA_SHIFT = 8; |
| 34 | static constexpr unsigned int TTO_DATA_SHIFT = 16; | ||
| 35 | static constexpr std::uint_fast32_t TTI_DATA = 0xff << TTI_DATA_SHIFT; | 46 | static constexpr std::uint_fast32_t TTI_DATA = 0xff << TTI_DATA_SHIFT; |
| 47 | static constexpr unsigned int TTO_DATA_SHIFT = 16; | ||
| 36 | static constexpr std::uint_fast32_t TTO_DATA = 0xff << TTO_DATA_SHIFT; | 48 | static constexpr std::uint_fast32_t TTO_DATA = 0xff << TTO_DATA_SHIFT; |
| 37 | 49 | ||
| 50 | // TT_FLAGS | ||
| 51 | static constexpr std::uint_fast32_t TTF_INT_ENABLE = 1 << 0; | ||
| 52 | static constexpr std::uint_fast32_t TTF_STATUS_ENABLE = 1 << 1; | ||
| 53 | |||
| 38 | struct instruction_context { | 54 | struct instruction_context { |
| 39 | // Known statically at decode time | 55 | // Known statically at decode time |
| 40 | bool need_indirect_load = false; // final_address = mem[init_address] | 56 | bool need_indirect_load = false; // final_address = mem[init_address] |
| @@ -65,4 +81,4 @@ struct instruction_context { | |||
| 65 | std::optional<unsigned int> mq; | 81 | std::optional<unsigned int> mq; |
| 66 | }; | 82 | }; |
| 67 | 83 | ||
| 68 | instruction_context decode(unsigned int df, unsigned int pc, unsigned int bits, bool interrupt); | 84 | instruction_context decode(std::uint_fast32_t flags, unsigned int pc, unsigned int bits, bool interrupt); |
