Это не HEX а BIN формат.
Вот преобразования:
Code
' BCD to BINARY conversion
' BCD2BIN_VAL is the input and output variable
BCD_TO_BIN:
nTEMP1 = nBCD2BIN_VAL & $F ' Convert the values from BCD to BIN
nTEMP2 = nBCD2BIN_VAL & $F0 ' Mast off either side
nTEMP2 = nTEMP2 >>4 ' divide by 16
nTEMP2 = nTEMP2 * 10 ' X by 10
nBCD2BIN_VAL = nTEMP1 + nTEMP2 ' Now add the original number
RETURN
'************************************************* **************
' BINARY to BCD conversion
' BIN2BCD_VAL is the input and output variable
BIN_TO_BCD:
nLow_Bits = nBIN2BCD_VAL // 10 'get lsb,same for Bin and BCD
nHigh_Bits = nBIN2BCD_VAL / 10 'get msb
nBIN2BCD_VAL = nHigh_Bits * 16 'covert msb to BCD
nBIN2BCD_VAL = nBIN2BCD_VAL + nLow_Bits 'add BCD msb and lsb together
RETURN