Friday, February 17, 2006

bitfields and bytes and words

Well, it started out as a "this will probably take 30 minutes" thing, and it just kept trundling on and became 4 hours, but I think the core of the code representing a generic, arbitrary length bitfield (which is now easily extendible) is kind of coming together now, so I can play around with bytes and words and have control over the flags, which means registers and memory should be easy to implement and hopefully, handling the D6 instruction set should be simple and intuitive.

Hopefully...


class Byte : public Bitfield {
public:
Byte(bool *_flags = 0) :
Bitfield(8, _flags) {}
void operator=(const int rhs) { Bitfield::operator =(rhs); };
};

class Word : public Bitfield {
public:
Word(bool *_flags = 0) :
Bitfield(16, _flags) {}
void operator=(const int rhs) { Bitfield::operator =(rhs); };
};


No comments:

Post a Comment