- // Spécification
-
- struct OCTET
- {
- unsigned msb : 1;
- unsigned _7 : 1;
- unsigned _6 : 1;
- unsigned _5 : 1;
- unsigned _4 : 1;
- unsigned _3 : 1;
- unsigned _2 : 1;
- unsigned lsb : 1;
-
- // Construction
- OCTET(unsigned char val = 0x00) {set_val_octet(val);}
- OCTET(bool, bool, bool, bool, bool, bool, bool, bool);
- OCTET(const OCTET&);
-
- // Manipule l'octet
- void set_val_octet(unsigned char);
- unsigned get_val_octet();
-
- // Pour affichage gui & console
- const char* set_buf_string(char[]);
- friend ostream& operator << (ostream&, const OCTET&);
- };
-
- // la structure mot
-
- struct MOT
- {
- OCTET hiByte;
- OCTET lowByte;
-
- MOT(unsigned short w = 0x0000) : hiByte(HIBYTE(w))
- , lowByte(LOBYTE(w)) {}
-
- // Wrapper affichage (pour ne pas passer plusieurs fois par l'octet)
- const char* affiche_mot(char lpBuffer[]);
- };
-
-
- // la structure doubleMot
-
- struct DOUBLEMOT
- {
- MOT hiWord;
- MOT lowWord;
-
- DOUBLEMOT(unsigned int d = 0x00000000) : hiWord(HIWORD(d))
- , lowWord(LOWORD(d)) {}
-
- // Wrapper affichage (pour ne pas passer plusieurs fois par le mot)
- const char* affiche_doublemot(char lpBuffer[]);
- };
// Spécification
struct OCTET
{
unsigned msb : 1;
unsigned _7 : 1;
unsigned _6 : 1;
unsigned _5 : 1;
unsigned _4 : 1;
unsigned _3 : 1;
unsigned _2 : 1;
unsigned lsb : 1;
// Construction
OCTET(unsigned char val = 0x00) {set_val_octet(val);}
OCTET(bool, bool, bool, bool, bool, bool, bool, bool);
OCTET(const OCTET&);
// Manipule l'octet
void set_val_octet(unsigned char);
unsigned get_val_octet();
// Pour affichage gui & console
const char* set_buf_string(char[]);
friend ostream& operator << (ostream&, const OCTET&);
};
// la structure mot
struct MOT
{
OCTET hiByte;
OCTET lowByte;
MOT(unsigned short w = 0x0000) : hiByte(HIBYTE(w))
, lowByte(LOBYTE(w)) {}
// Wrapper affichage (pour ne pas passer plusieurs fois par l'octet)
const char* affiche_mot(char lpBuffer[]);
};
// la structure doubleMot
struct DOUBLEMOT
{
MOT hiWord;
MOT lowWord;
DOUBLEMOT(unsigned int d = 0x00000000) : hiWord(HIWORD(d))
, lowWord(LOWORD(d)) {}
// Wrapper affichage (pour ne pas passer plusieurs fois par le mot)
const char* affiche_doublemot(char lpBuffer[]);
};