ARM Technical Support Knowledge Articles

KEEPING HEX RECORDS IN ORDER

Applies to: OH51 Object-HEX Converter

Answer


Information in this article applies to:


SYMPTOMS

OH51 doesn't seem to generate Intel HEX records that are in address order. This causes havoc with the emulator I use. Is there a way around this problem?

CAUSE

This is correct operation of OH51. There is nothing in the Intel HEX specification that stated that the records must be in any specific order.

RESOLUTION

The easiest resolution to this problem is to use the MS-DOS SORT utility to sort the records into a new HEX file. To do this.

  1. Edit the original HEX file (called oldfile.hex in this example) and remove the last line of the file. This line is the EOF record and can't be correctly sorted. It appears exactly as follows:
    :00000001FF
    
  2. Use the following DOS command line to sort the edited HEX file (this works from MS-DOS as well as from Windows 95/98/NT):
    sort /+4 oldfile.hex > newfile.hex
    
  3. Edit newfile.hex and, on a new line, add the EOF record at the end of the file.
    :00000001FF
    

    Note that only Intel HEX-86 files may be sorted using this method. HEX-286 and HEX-386 files have segment records that may get located incorrectly using this technique.

MORE INFORMATION

SEE ALSO

Article last edited on: 2007-07-10 00:25:48

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential