|
contur2
|
The CPU's register bank — holds REGISTER_COUNT (16) registers. More...
#include <register_file.h>
Public Member Functions | |
| RegisterFile () | |
| ~RegisterFile () | |
| RegisterFile (const RegisterFile &)=delete | |
| RegisterFile & | operator= (const RegisterFile &)=delete |
| RegisterFile (RegisterFile &&) noexcept | |
| RegisterFile & | operator= (RegisterFile &&) noexcept |
| RegisterValue | get (Register reg) const noexcept |
| Gets the value of the specified register. | |
| RegisterValue | get (std::uint8_t index) const noexcept |
| Gets the value of a register by raw index. | |
| void | set (Register reg, RegisterValue value) noexcept |
| Sets the value of the specified register. | |
| void | set (std::uint8_t index, RegisterValue value) noexcept |
| Sets the value of a register by raw index. | |
| RegisterValue | pc () const noexcept |
| Convenience accessor for the Program Counter. | |
| void | setPc (RegisterValue value) noexcept |
| Sets the Program Counter. | |
| RegisterValue | sp () const noexcept |
| Convenience accessor for the Stack Pointer. | |
| void | setSp (RegisterValue value) noexcept |
| Sets the Stack Pointer. | |
| void | reset () noexcept |
| Resets all registers to zero. | |
| std::array< RegisterValue, REGISTER_COUNT > | snapshot () const noexcept |
| Returns a snapshot of all register values as an array. Used for context switching (save/restore). | |
| void | restore (const std::array< RegisterValue, REGISTER_COUNT > &values) noexcept |
| Restores register values from a previously taken snapshot. | |
| std::string | dump () const |
| Returns a formatted string showing all register values. | |
Private Attributes | |
| std::unique_ptr< Impl > | impl_ |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const RegisterFile &rf) |
| Stream output operator for debug printing. | |
The CPU's register bank — holds REGISTER_COUNT (16) registers.
Provides safe access by Register enum or raw index, bulk save/restore (for context switching), and formatted debug output.
Definition at line 49 of file register_file.h.
| contur::RegisterFile::RegisterFile | ( | ) |
| contur::RegisterFile::~RegisterFile | ( | ) |
|
delete |
|
noexcept |
|
nodiscard |
Returns a formatted string showing all register values.
|
nodiscardnoexcept |
Gets the value of the specified register.
|
nodiscardnoexcept |
Gets the value of a register by raw index.
|
delete |
|
noexcept |
|
nodiscardnoexcept |
Convenience accessor for the Program Counter.
|
noexcept |
Resets all registers to zero.
|
noexcept |
Restores register values from a previously taken snapshot.
|
noexcept |
Sets the value of the specified register.
|
noexcept |
Sets the value of a register by raw index.
|
noexcept |
Sets the Program Counter.
|
noexcept |
Sets the Stack Pointer.
|
nodiscardnoexcept |
Returns a snapshot of all register values as an array. Used for context switching (save/restore).
|
nodiscardnoexcept |
Convenience accessor for the Stack Pointer.
|
friend |
Stream output operator for debug printing.
|
private |
Definition at line 107 of file register_file.h.