-
Writing HEX values
Hi,
I have to do the followin:
Messages always start with the statemnt of their length ('0000' - 'FFFF' Hex) as a 2 byte long binary value (i.e. not as a string) in the Intel notation (LSB first).
How do I write that into a file? After the length, the line will contain string values.
also, what is Intel Notation (LSB first)?
Thanks,
-
LSB is least significant byte. 'LSB first' would be what is called little-endian, which is how the value is stored in memory. The LSB is stored in the lower (of the two) memory address, the MSB is stored at the next address. With 2 bytes, you are dealing with an Integer. So, if the Integer contained x15F3, the 2 bytes would be stored in memory as F3 15.
It apppears that your task is to write an Integer followed by a string.