I have the following class:
class risc { // singleton protected: static unsigned long registers[8]; public: unsigned long operator [
You need to return a reference from your operator[] so that the user of the class use it for setting the value. So the function signature would be unsigned long& operator [](int i).
operator[]
unsigned long& operator [](int i)