MIXAL
registers.h
Go to the documentation of this file.
1 #ifndef INCLUDE_REGISTERS_H_
2 #define INCLUDE_REGISTERS_H_
3 
4 #include <cstdint>
5 #include "memory.h"
6 
12 namespace mixal {
13 
16 
23 struct Register2 {
24  bool negative;
25  uint8_t byte1;
26  uint8_t byte2;
27 
29  Register2();
34  explicit Register2(int16_t value);
36  Register2(bool _negative, uint8_t _byte1, uint8_t _byte2);
41  Register2(char sign, uint8_t _byte1, uint8_t _byte2);
42 
44  inline void reset() {
45  negative = false;
46  byte1 = byte2 = 0;
47  }
48 
53  uint8_t operator[](int index) const;
55  uint16_t bytes12() const;
57  int16_t value() const;
58 
69  void set(int16_t value);
77  void set(int index, int8_t val);
79  void set(bool negative, uint8_t byte1, uint8_t byte2);
84  void set(char sign, uint8_t byte1, uint8_t byte2);
85 };
86 
87 }; // namespace mixal
88 
89 
90 #endif // INCLUDE_REGISTERS_H_
mixal::ComputerWord
Definition: memory.h:25
mixal::Register2::set
void set(int16_t value)
Definition: registers.cpp:46
mixal::Register2::operator[]
uint8_t operator[](int index) const
Definition: registers.cpp:25
mixal::Register2::Register2
Register2()
Definition: registers.cpp:7
mixal::Register2::bytes12
uint16_t bytes12() const
Definition: registers.cpp:35
mixal::Register2::value
int16_t value() const
Definition: registers.cpp:41
mixal::Register2
Definition: registers.h:23
mixal::Register2::reset
void reset()
Definition: registers.h:44
memory.h
The definition of a computer word.