13template <
typename TCpuAccessor,
typename TBus>
class Fetcher {
15 static Result<RawInstr> Fetch(TCpuAccessor &cpua, TBus &bus,
const me_adr_t pc) {
20 bus.template ReadOrRaise<u16>(cpua, pc, BusExceptionType::kRaiseInstructionBusError));
26 const auto flags = kRawInstrFlagsTable[opc];
28 if ((flags &
static_cast<RawInstrFlagsSet
>(RawInstrFlagsMsk::k32Bit)) != 0U) {
31 bus.template ReadOrRaise<u16>(cpua, pc + 2U,
32 BusExceptionType::kRaiseInstructionBusError));
36 return Ok(
RawInstr{instr_l, instr_h, flags});
54 Fetcher &operator=(
const Fetcher &r_src) =
delete;
60 Fetcher(Fetcher &&r_src) =
delete;
66 Fetcher &operator=(Fetcher &&r_src) =
delete;
#define TRY_ASSIGN(NAME, OUT_TYPE, CALL)
Try to assign a value to a variable and return an error if the assignment fails.
Definition result.h:123