libmicroemu 0.2.0
ARM Microcontroller Emulator Library
Loading...
Searching...
No Matches
mnemonic_builder_ternary_null_instr_with_shift.h
1#pragma once
2
4#include "libmicroemu/types.h"
5
6namespace libmicroemu::internal {
7
11template <typename TContext> class MnemonicBuilderTernaryNullInstrWithShift {
12public:
13 using It = typename TContext::It;
14 using Reg = typename TContext::Reg;
15 using SReg = typename TContext::SReg;
16
17 template <typename TArg0, typename TArg1>
18 static void Build(const char *instr_spec, TContext &mctx, const MnemonicBuilderFlagsSet &bflags,
19 const InstrFlagsSet &iflags, const TArg0 &rn, const TArg1 &rm,
20 const ImmShiftResults &shift_res, bool supress_type) {
21
22 static_cast<void>(bflags);
23 const bool is_setflags = (iflags & static_cast<InstrFlagsSet>(InstrFlags::kSetFlags)) != 0U;
24 mctx.builder.AddString(instr_spec)
25 .AddString(is_setflags == true ? "S" : "")
26 .AddString(It::GetConditionAsStr(mctx.cpua))
27 .AddChar(' ')
28 .AddString(Reg::GetRegisterName(rn.Get()))
29 .AddString(", ")
30 .AddString(Reg::GetRegisterName(rm.Get()));
31
32 if (shift_res.value != 0) {
33 mctx.builder.AddString(", ");
34
35 if (!supress_type) {
36 mctx.builder.AddString(shift_res.GetShiftTypeAsStr()).AddChar(' ');
37 }
38 mctx.builder.AddString("#").AddUInt(shift_res.value);
39 }
40 mctx.builder.Terminate();
41 }
42
43private:
47 MnemonicBuilderTernaryNullInstrWithShift() = delete;
48
52 ~MnemonicBuilderTernaryNullInstrWithShift() = delete;
53
58 MnemonicBuilderTernaryNullInstrWithShift(const MnemonicBuilderTernaryNullInstrWithShift &r_src) =
59 default;
60
65 MnemonicBuilderTernaryNullInstrWithShift &
66 operator=(const MnemonicBuilderTernaryNullInstrWithShift &r_src) = delete;
67
72 MnemonicBuilderTernaryNullInstrWithShift(MnemonicBuilderTernaryNullInstrWithShift &&r_src) =
73 delete;
74
79 MnemonicBuilderTernaryNullInstrWithShift &
80 operator=(MnemonicBuilderTernaryNullInstrWithShift &&r_src) = delete;
81};
82
83} // namespace libmicroemu::internal
The libmicroemu::internal namespace contains all classes and functions of libmicroemu which are priva...
Definition bkpt_flags.h:6
Contains the Result class which is used to return the result of a function.
Definition imm_shift_results.h:15