SPRUI03E June 2015 – January 2023
The ROMS directive specifies the physical memory configuration of your system as a list of address-range parameters. Each address range produces one set of files containing the hex conversion utility output data that corresponds to that address range. Each file can be used to program one single ROM device.
The ROMS directive is similar to the linker's MEMORY directive: both define the memory map of the target address space. Each line entry in the ROMS directive defines a specific address range. The general syntax is:
ROMS { | |||
romname: | [origin=value,] [length=value,] [romwidth=value,] [memwidth=value,] [fill=value] [files={filename1, filename2, ...}] | ||
romname: | [origin=value,] [length=value,] [romwidth=value,] [memwidth=value,] [fill=value] [files={filename1, filename2, ...}] | ||
... | |||
} |
ROMS | begins the directive definition. |
romname | identifies a memory range. The name of the memory range can be one to eight characters in length. The name has no significance to the program; it simply identifies the range, except when the output is for a load image in which case it denotes the section name. (Duplicate memory range names are allowed.) |
origin | specifies the starting address of a memory range. It can be entered as origin, org, or o. The associated value must be a decimal, octal, or hexadecimal constant. If you omit the origin value, the origin defaults to 0. The following table summarizes the notation you can use to specify a decimal, octal, or hexadecimal constant: |
Constant | Notation | Example |
---|---|---|
Hexadecimal | 0x prefix or h suffix | 0x77 or 077h |
Octal | 0 prefix | 077 |
Decimal | No prefix or suffix | 77 |
length | specifies the length of a memory range as the physical length of the ROM device. It can be entered as length, len, or l. The value must be a decimal, octal, or hexadecimal constant. If you omit the length, it defaults to the length of the entire address space. |
romwidth | specifies the physical ROM width of the range in bits (see Section 11.4.3). Any value specified here overrides the --romwidth option. The value must be a decimal, octal, or hexadecimal constant that is a power of 2 greater than or equal to 8. |
memwidth | specifies the memory width of the range in bits (see Section 11.4.2). Any value you specify here overrides the --memwidth option. The value must be a decimal, octal, or hexadecimal constant that is a power of 2 greater than or equal to 8. When using the memwidth parameter, you must also specify the paddr parameter for each section in the SECTIONS directive. (See Section 11.6.) |
fill | specifies a fill value to use for the range. In image mode, the hex conversion utility uses this value to fill any holes between sections in a range. A hole is an area between the input sections that comprises an output section that contains no actual code or data. The fill value must be a decimal, octal, or hexadecimal constant with a width equal to the target width. Any value you specify here overrides the --fill option. When using fill, you must also use the --image command line option. (See Section 11.10.2.) |
files | identifies the names of the output files that correspond to this range. Enclose a list of names in curly braces and order them from least significant to most significant output file, where the bits of the memory word are numbered from right to left. The number of file names must equal the number of output files the range generates. To calculate the number of output files, see Section 11.4.3. The utility warns you if you list too many or too few filenames. |
Unless you are using the --image option, all of the parameters that define a range are optional; the commas and equal signs are also optional. A range with no origin or length defines the entire address space. In image mode, an origin and length are required for all ranges.
Ranges must not overlap and must be listed in order of ascending address.