j'ai d�clar� une structure; un registre 48 bit accessible chaque 6 bits comme suit
Et quand j'utilise �a:
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5
6
7
8
9 typedef struct reg48 { unsigned int b7:6 ,b6:6 ,b5:6 ,b4:6, b3:6, b2:6, b1:6, b0:6; } reg48; typedef union reg48_6 { unsigned __int64 reg;// pour un accés à toute la valeurs reg48 b; }reg48_6;
�a me donne la m�me d�composition pour les 2 DIFFERENTS NOMBRES!!, et elle est fausse!!!.
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5
6
7
8
9
10 s.reg=0x5bdadd934fad; cout<<hex<<s.reg<<"\n"; cout<<hex<<s.b.b0<<" "<<s.b.b1<<" "<<s.b.b2<<" "<<s.b.b3<<" "<<s.b.b4<<" "<<s.b.b5; cout<<" "<<hex<<s.b.b6<<" "<<s.b.b7<<"\n"; s.reg=0x5bda5d934fad; cout<<hex<<s.reg<<"\n"; cout<<hex<<s.b.b0<<" "<<s.b.b1<<" "<<s.b.b2<<" "<<s.b.b3<<" "<<s.b.b4<<" "<<s.b.b5; cout<<" "<<hex<<s.b.b6<<" "<<s.b.b7<<"\n";
j'ai affich� en binaire, j'ai remarqu� que 2 bits aux milieu sont ignor�!!!
je ne comprend pas pourquoi?
COMMENT FAIRE UNE D�COMPOSITION DE MON REGISTRE?
Partager