12 * @brief Represents the stack within the chip.
14 * A software stack implementation. Provides methods
15 * for pushing and popping.
17 class Stack
: public Hardware
{
19 Stack(Bus
& bus
, MMU
& mmu
, word mask
);
23 unsigned char getSPH() const;
24 unsigned char getSPL() const;
29 void push(unsigned char val
);
33 bool attachReg(const char *name
, IORegister
*reg
);
35 void regChanged(IORegister
*reg
);
38 void setSPH(unsigned char sph
);
39 void setSPL(unsigned char spl
);
51 inline unsigned char Stack::getSPH() const {
52 return (sp
>>8) & 0xff;
55 inline unsigned char Stack::getSPL() const {
59 inline word
Stack::getSP() const {
63 inline void Stack::setSPH(unsigned char sph
) {
69 inline void Stack::setSPL(unsigned char spl
) {
77 #endif /*AVR_STACK_H*/