|
union {
float Number;
unsigned char Bytes[4];
} IEEEfloat;
void __fastcall TForm1::ASCII_TextEditChange(TObject *Sender)
{
IEEEfloat.Number = (float)atof(ASCII_TextEdit->Text.c_str());
Label3->Caption = IntToHex(IEEEfloat.Bytes[3], 2);
Label4->Caption = IntToHex(IEEEfloat.Bytes[2], 2);
Label5->Caption = IntToHex(IEEEfloat.Bytes[1], 2);
Label6->Caption = IntToHex(IEEEfloat.Bytes[0], 2);
Label8->Caption = IntToHex(((IEEEfloat.Bytes[3]<<1)|((IEEEfloat.Bytes[2]>>7)&0x01))&0xFF, 2);
Label9->Caption = IntToHex((IEEEfloat.Bytes[2]&0x7F)|(IEEEfloat.Bytes[3]&0x80), 2);
Label10->Caption = IntToHex(IEEEfloat.Bytes[1], 2);
Label11->Caption = IntToHex(IEEEfloat.Bytes[0], 2);
}
E-mail: info@telesys.ru