|
-
Nov 26th, 2003, 02:37 PM
#1
Thread Starter
Frenzied Member
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,
Don't anthropomorphize computers -- they hate it
-
Nov 26th, 2003, 04:19 PM
#2
Frenzied Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|