Results 1 to 2 of 2

Thread: Writing HEX values

  1. #1

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950

    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

  2. #2
    Frenzied Member
    Join Date
    Aug 2000
    Location
    O!
    Posts
    1,177
    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
  •  



Click Here to Expand Forum to Full Width