.TH MLOAD 1 .SH NAME mload \- multiple Intel HEX file loader / patch loader .SH SYNOPSIS .B mload .RB [[ -a startaddr] bfile] .RB [ -o ofile] .RB [ \-f fvalue] [hexfile ...] .br .B mload -h .SH DESCRIPTION .I mload converts Intel HEX files into binary. Unlike the CP/M .I load command, .I mload does not pad output files with 00s if they are not loaded at 0100H; it only saves the area actually loaded. It also deals correctly with HEX files whose records are not in address order, and understands the extended (20-bit) format, including base-address records and EOF records. It can be used as a filter, as a file converter, or as a means to patch binary files, according to the command line switches (see below). .PP In its simplest form, .I mload reads a file in valid Intel HEX format, and writes out a binary copy. If no file names are given, .I mload reads and writes standard input and output. If one or more filenames are given, input is read from these files instead of stdin. .PP The first file read (other than stdin) is checked to see if it is a binary (ie non Intel-HEX) file. If so, it is loaded 'as-is' at the default address of 0100H. This provides a means to apply HEX patches to binary files. The load address may be changed with .BR \-a . Subsequent files, which must all contain valid HEX records, are loaded over this (if appropriate). If only one filename is given, and it is not a HEX file, subsequent input is assumed to come from stdin. .PP The following options are recognised by .IR mload : .TP 6 .B \-? prints the 'Usage:" information, and exits. .TP .BI \-a " startaddr bfile" use the hexadecimal value .I startaddr as the address to load the file .IR bfile . The named file will be loaded as binary, not HEX. Either upper- or lower-case hexadecimal digits may be used. .TP .BI \-f " fvalue" the 8-bit hexadecimal .I fvalue is used to fill any gaps in loaded files. If .B \-f is not used, a default value of 0FFH is applied. .TP .B \-h variant of .B \-? .TP .BI \-o " ofile" causes output to be written to .I ofile instead of standard output. .PP .B Examples. .br To convert a HEX file called .I fred.hex to a binary file called .IR fred.bin , either of the the following commands may be used: .br mload -o fred.bin fred.hex .br mload fred.bin .br To load a CP/M executable called .I fred.com and apply a pair of patches, saving the result in .IR fredp.com : .br mload fred.com patch1 patch2 >fredp.com .br To assemble a patch for a ROM image which is based at 0E000H, and apply it in a pipeline: .br zasm -l patch.lst patch.asm | mload -a E000 fred.com -o fred.rom .PP .I mload recognises end-of-data in a HEX file in either of two ways: .br (1) a type-0 data record at address 0000 with zero data bytes .br .B :0000000000 (the original CP/M method); or .br (2) a type-1 record .B :00000001FF .SH AUTHOR Pete Turnbull (pnt103@cs.york.ac.uk) .SH BUGS .I mload should accept the name .B \- as an synonym for stdin, amongst the input file names. .SH "SEE ALSO" .I mload.doc Ron Fowler, Nightowl Software, 1988. The inspiration for this program.