grom960 ROM Image Generator


grom960 extracts the text (executable code) and data sections from one or more object files, places them in specified locations in a binary image, and converts the binary image into one or more files in Intel hex format. The resulting files can be downloaded to a PROM programming device. grom960 also provides options that allow bytes from the binary image to be interleaved into multiple banks of PROMs.

The invocation command is:

grom960 [ -option ]... section_spec...

Each option must be preceded by a - character. (On DOS, you can also use a / character.) The options are listed below.

A section_spec specifies the placement of a text or data section into the binary image. Multiple specifications are allowed; they are processed in the order encountered. There are four types, listed below.


Section Specifications


The addr argument is always optional. An omitted address causes the specified section(s) to be placed immediately after the one in the preceding specification (or at address 0 in the binary image, in the case of the first section specification).


Options


Numeric arguments are interpreted as decimal, unless preceded by 0x (hex).


Using grom960


Generating ROM images is a two-step process: creation of a binary image, and conversion of the image to ROM image (Intel hex) files.

Generating Binary Images

Regardless of the addresses where the code was linked, all bytes in a ROM image appear in a contiguous address space relative to the ROMs' base address. For instance, a 64K ROM based at address 0xffff0000 has a ROM address space of [0,0xffff], byte 0 of the ROM being the byte which will be addressed at 0xffff0000 at run time.

The binary image is generated by extracting the text and data sections of the input files and placing them at the specified locations in the ROM address space. Unused address space bytes are initialized to 0xff, the value of a byte in an erased PROM.

Hex File Generation

After a single binary image has been created, it is interleaved according to the ROM width and the number of banks requested. If the width is w, and the number of banks is b, the first w bytes in the image are written to the first bank of ROMs, then the second w bytes are written to the second bank, and so on. After bth bank has been written, output resumes at the first bank. For example, if the number of banks is four, the ROM width is two, and the first sixteen bytes of the image are:

0x00112233445566778899aabbccddeeff

then the four banks would begin with the following values:

bank 0: 0x00118899...

bank 1: 0x2233aabb...

bank 2: 0x4455ccdd...

bank 3: 0x6677eeff...

Each bank corresponds to at least one ROM. Every time the amount of data written to a bank exceeds the specified ROM length, a new ROM image file is started.

Each output file is in Intel hex format and corresponds to a single ROM device. The output files are named basenamexy.hex, where y is the bank number and x is the sequence number within the bank. Both x and y are numbered from 0. For example, if the number of banks is four, the ROM length is 64 K, and the total image size is 512K, then the following hex files would be output:

bank 0: rom00.hex, rom10.hex

bank 1: rom01.hex, rom11.hex

bank 2: rom02.hex, rom12.hex

bank 3: rom 03.hex, rom13.hex.


Return to the top of this page.

Go to the ic960 Interface Index.

Go to the gcc960 Interface Index.