libmicroemu 0.2.0
ARM Microcontroller Emulator Library
Loading...
Searching...
No Matches
mnemonic_builder_binary_instr_with_rotation.h
1#pragma once
2
4#include "libmicroemu/types.h"
5
6namespace libmicroemu::internal {
7
11template <typename TContext> class MnemonicBuilderBinaryInstrWithRotation {
12public:
13 using It = typename TContext::It;
14 using Reg = typename TContext::Reg;
15 using SReg = typename TContext::SReg;
16 template <typename TDest, typename TArg0>
17 static void Build(const char *instr_spec, TContext &mctx, const MnemonicBuilderFlagsSet &bflags,
18 const InstrFlagsSet &iflags, const TDest &rd, const TArg0 &rm,
19 const u8 &rotation) {
20 static_cast<void>(bflags);
21 const bool is_setflags = (iflags & static_cast<InstrFlagsSet>(InstrFlags::kSetFlags)) != 0U;
22 mctx.builder.AddString(instr_spec)
23 .AddString(is_setflags == true ? "S" : "")
24 .AddString(It::GetConditionAsStr(mctx.cpua))
25 .AddChar(' ')
26 .AddString(Reg::GetRegisterName(rd.Get()))
27 .AddString(", ")
28 .AddString(Reg::GetRegisterName(rm.Get()));
29
30 if (rotation != 0U) {
31 mctx.builder.AddString(", ROR #").AddUInt(rotation);
32 }
33
34 mctx.builder.Terminate();
35 }
36
37private:
41 MnemonicBuilderBinaryInstrWithRotation() = delete;
42
46 ~MnemonicBuilderBinaryInstrWithRotation() = delete;
47
52 MnemonicBuilderBinaryInstrWithRotation(const MnemonicBuilderBinaryInstrWithRotation &r_src) =
53 default;
54
59 MnemonicBuilderBinaryInstrWithRotation &
60 operator=(const MnemonicBuilderBinaryInstrWithRotation &r_src) = delete;
61
66 MnemonicBuilderBinaryInstrWithRotation(MnemonicBuilderBinaryInstrWithRotation &&r_src) = delete;
67
72 MnemonicBuilderBinaryInstrWithRotation &
73 operator=(MnemonicBuilderBinaryInstrWithRotation &&r_src) = delete;
74};
75
76} // 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.