I did some more work on the "SimpleGPC" model, well...simple for a GPC, when the last concept errors are fixed, it should be possible to use HAL/S data types, COMPOOLS, processes and other features of the GPCs.
Code:
class INTEGER: public Symbol
{
word16* m_var;
public:
INTEGER();
INTEGER(const std::string& name, word16 hw_addr);
INTEGER(const INTEGER& copy);
virtual ~INTEGER();
virtual word32 Resolve(GPC* gpc, word32 base_addr);
INTEGER& operator =(const INTEGER& b) const;
bool operator ==(const INTEGER& b) const;
bool operator >=(const INTEGER& b) const;
bool operator <=(const INTEGER& b) const;
bool operator >(const INTEGER& b) const;
bool operator <(const INTEGER& b) const;
INTEGER& operator -(const INTEGER& b) const;
INTEGER& operator +(const INTEGER& b) const;
INTEGER& operator *(const INTEGER& b) const;
INTEGER& operator /(const INTEGER& b) const;
INTEGER& operator &(const INTEGER& b) const;
INTEGER& operator |(const INTEGER& b) const;
};
...
...
...
class FCOS: public GPCSoftware {
PROCEDURE FPMSVC;
PROCEDURE FPMSCHED;
PROCEDURE FPMCHPCT;
PROCEDURE FPMCVTFX;
PROCEDURE FPMEVENQ;
PROCEDURE FPMEVAL;
PROCEDURE FPMSWITCH;
public:
FCOS(GPC* gpc);
virtual ~FCOS();
virtual word16 operator()(word16 instr_addr);
};
Still not completely free of design flaws, but I think the concept makes sense. The software would still be hard-coded in C++, but would be close enough to HAL/S to behave like the original software. The variables could be shared by different active processes (up to 30 when using the PASS standards), without having complex data passing and sharing between local and global data.