Home: semmix.homepage.com
      goto: polska wersja
HEX File Format IntelHEX simplified IntelHEX general IntelHEX mutations S-Record simplified S-Record general TekHex Tektronix HEX MosTech

HEX File Format

Data, designed to keep in the memory EPROM, PROM and the like, can be code in some ways. There are some types of files which are designed for this kind of data. The files are produced by LINKERs, DEBUGGERs or may be generated by the special programs converting, or reading out the contents of memory. In general, such the file contains the readed out contents or the contents which is to be kept in memory.

BIN files:

The simplest case may be the file defined as binary, and in general, enlargement of the name of file is: ".BIN". The usual binary file is the usual picture of memory recorded in file. Such the files are used more rarely, but they are in use.

HEX files:

More commonly there are used the files with binary contents specially coded by ASCII characters (American Standard Code for Information Interchange). Their format is named: HEXADECIMAL. They have got a construction of common files TXT. It means that the file is composed of records (lines of text), ended EOL (CR | NL or only NL in unix). The inside of record has the characters compatible with standard and interpretation ASCII. One record contains coded PORTION - fragment of picture of memory, and such information as: the length of portion, and the address of beginning for portion in the address space of memory. Or it is an organizational record. That way allows to make description of the contents not necessarily for all the memory. Records don't have to describe the successive fragments of memory in a constant way.

The general model of type INTEL:

The general model record IntelHex.

The general model of type S-record Motorola:

The general model S-record Motorola.

There are certain deviations from the above mentioned models. These are the deviations concerning mainly with the fact, that the logical fields in record, of which the contents may assume only several values, are defined as only ONE ASCII CHARACTER in record - but not by PAIR of characters.

The larger firms, producing EPROM, PROM memories, or microprocessors, have worked out their own models for the discussed files. The common feature however is coding for single byte. The value of one byte is represented by two ASCII characters. The first characters carries out of its value for older "four" of bits, and the second character - for younger "four". In the record is found the address of portion's start in memory. Such an address may consist of 2, 3 or 4 and even to 8 bytes. For these parameters there is adopted as well the principle that the successive bytes as PAIRS of ASCII characters correspond the successive bytes of the address register successively HIGH ... LOW. This rule do not applied to the contents of PORTION. If byte is the unit, to which the memory is addressed, then there is no problem of interpretation. The problem appears when the 2-byte WORD or consisting of larger number of bytes is the unit of addressing. At that time the fixing of succession HIGH ... LOW or LOW ... HIGH is necessary.


Links to subject:

Autor: Emmix. Translate to english: MeryK.


(C) 2000 SEII EM-MI POLAND