libmicroemu 0.2.0
ARM Microcontroller Emulator Library
Loading...
Searching...
No Matches
register_id.h
1#pragma once
2
3#include "libmicroemu/types.h"
4
5namespace libmicroemu {
6
13enum class RegisterId : u8 {
14 kR0 = 0U,
15 kR1 = 1U,
16 kR2 = 2U,
17 kR3 = 3U,
18 kR4 = 4U,
19 kR5 = 5U,
20 kR6 = 6U,
21 kR7 = 7U,
22 kR8 = 8U,
23 kR9 = 9U,
24 kR10 = 10U,
25 kR11 = 11U,
26 kR12 = 12U,
27 //
28 kSp = 13U,
29 kR13 = 13U,
30 // ---
31 kLr = 14U,
32 kR14 = 14U,
33 // ---
34 kPc = 15U,
35 kR15 = 15U
36};
37
39constexpr auto kLastRegister = RegisterId::kR15;
40
45static constexpr u32 CountRegisters() noexcept { return static_cast<u32>(kLastRegister) + 1U; };
46} // namespace libmicroemu
The libmicroemu namespace contains all classes and functions of the libmicroemu which are public.
Definition bkpt_flags.h:6
static constexpr u32 CountRegisters() noexcept
Returns the number of general-purpose registers.
Definition register_id.h:45
constexpr auto kLastRegister
The last register ID.
Definition register_id.h:39
RegisterId
Enumeration of register IDs.
Definition register_id.h:13
@ kPc
Program-counter register.
Definition register_id.h:34
@ kLr
Link-register.
Definition register_id.h:31
@ kSp
Stack-pointer register.
Definition register_id.h:28