.R:Q
.X:10
.H:=======================IHX.EXE===========================
.H:
.F:...$$YEMODA$$/Odd...$$$


THE INTEL-EXTENDED-HEX FILE CONVERTER for PC/XT/AT.



The IHX.EXE program reads Intel hex records, extended 
addressing and produces ordinary Intel hex records.


To do this IHX needs the following:

   1) an input file which contains Intel hex records.

   2) a physical prom address between 00000 and FFFFF hex

   3) the prom size.

IHX will read the input file and extract the datarecords 
which belong in the prom and write them to a separate file
with address-fields relative to the prom address.

Data falling outside the prom are ignored. 

Depending on the start and end address for each data record 
IHX sort them into 6 categories:


    1) starts below prom  ends below  prom  
    2) starts below prom  ends inside prom 
    3) starts inside prom ends inside prom 
    4) starts inside prom ends above  prom
    5) starts above  prom ends above  prom
    6) starts below  prom ends above  prom

IHX will treat the 6 categories as follows:

    1) Ignored
    2) Split at low prom border. Use high end of block
    3) Use all of the block
    4) Split at high prom border. Use low end of block
    5) Ignored
    6) Ignored


The input file is left unchanged. The extracted data blocks 
are written to a file having the same name as the input 
file, but the extension will be ".IHX"



HOW TO USE IHX.EXE



IHX.EXE responds to the following syntax:


IHX [-options] <input file>  [prom addr]  [promsize]


Where information in square brackets [ ] is optional. IHX 
will use default values if not supplied.


options:     -e  = IHX does not put an Intel-hex eof record 
                   at the end of of the output file. This is
                   nice when sending more than 1 file to the
                   prom programmer. 

             -s  = IHX will display  the encountered segment-
                   values in extended address records.
                  
                   options may be combined to: -es or -se.
                   -e -s  or  -s -e will also work.
                   

input file:        normal MSDOS spec's. Default extension is 
                   ".HEX" of not supplied in the commandline


prom addr:         The absolute, physical prom address. Must
                   be entered in hex. Do NOT use the segment
                   value which the 8086/88 utilities put 
                   into the hex-file.
                   The address should reflect the physical
                   20 bit address.
                   If the prom resides at segment C000 and
                   offset 800H then prom addr must be 
                   entered as C0800.

                   The default prom address is F0000 hex, 
                   which is the upper 64K segment.

prom size:         prom size in bytes. Default = 10000 hex
                   or 64K.


THE CONVERSION REPORT.

When IHX terminates a conversion report is displayed. IHX 
will let you know how many data and address records were 
examined, how many datarecords were written to the output 
file, if any data records were split etc.....

If IHX reports more than 1 split record at each prom border 
you have overlapping data in your hex file.

IHX can not cure this. The output file will contain two 
records with data belonging to the same locations.
If you send such a file to the prom programmer the first
data will be overwritten by the next and the next and the 
next ........   Check your source files and the memory
allocations.



IHX HELP.

If you forget how to operate IHX then just invoke it with no 
parameters. IHX will then display a help-screen.






IHX SESSION EXAMPLE:

The files TEST1.HEX  TEST2.HEX and TEST3.HEX contain  
datarecords belonging to several segments in the 8086/88  
address space.  


I know that the data records will all fit into 2 memory
blocks, each less than 4 kilobytes.

One memoryblock (prom) is located at D000:0400H and the other
at E000:0800H  (using the Intel seg:offset notation)

The command IHX -e TEST1 D0400 1000   produces TEST1.IHX
            IHX -e TEST2 D0400 1000   produces TEST2.IHX
            IHX    TEST3 D0400 1000   produces TEST3.IHX

note the use of the -e option. Only TEST3.IHX will have an
end of file record.
Now, assuming that the programmer is hooked up to com1 and 
that com1 is configured, set the programmer to recieve Intel
hex files.
Then
    COPY TEST1.IHX COM1:  sends the first file 
    COPY TEST2.IHX COM1:  sends the second and
    COPY TEST3.IHX COM1:  sends the last.

After recieving the last file the prom programmer will 
escape from its file recieve mode because it did recieve an 
end of file record.

Plug an erased/blank prom ito the zif and BURN. Put prom 
into computer at address D0400 hex.

Repeat the sequence but now enter the following commands:

IHX -e TEST1 E0800 1000  to produce a new TEST1.IHX
IHX -e TEST2 E0800 1000  makes a new TEST2.IHX
IHX    TEST3 E0800 1000  makes a new TEST3.IHX

(the prvious *.IHX files are lost!)


Now, get the prom programmer into the file recieve mode 
again and repeat the copy commands above.
Burn the second prom and install it at address E0800 hex.

