sim: added uart extension
[calu.git] / 3b_sim / extensions / cprog.hpp
1 #include "../iext.hpp"
2
3 class Cprog : public Iext {
4         public:
5                 Cprog() : m_writeAddress(0) {};
6                 void applyTick() {};
7                 void loadData(const int address, CDat value);
8                 CDat readData(const int) { return 0; }
9                 void parseInput(const vector<string>&)  {};
10         private:
11                 int m_writeAddress;
12 };
13
14 void Cprog::loadData(const int address, CDat value)
15 {
16         if(address == 0x2034) {
17                 m_writeAddress = (value*4);
18                 //adress pointer
19         }
20         else if(address == 0x2038) {
21                 this->m_cpu->setProg(m_writeAddress, m_disasm->decodeNum(value));
22                 m_writeAddress += 4;
23                 //data pointer
24         }
25 }