Table of Contents        Previous topic       Next topic       

LINKER->Linker Command Line Options->Specify ROM Limits (/ROM:)

This option specifies the area of rom available for the relocatable code sections.  

The format is:

/ROM:[low address]:[high address]

[low address] and [high address] should be specified in hexadecimal.

(Do not use an 'H' after the hexadecimal numbers).

The default low address is zero and the default high address is 0FFFFH and so the range zero to 0FFFFH will be used if no /ROM option is used.

An example directive is:


This will cause the linker to place program code in the address range zero to 07FFFH.

Multiple /ROM directives can be used to specify discontinuous regions of rom.  For example:

/ROM:0000:7FFF /ROM:A000:AFFF

tells the linker to use address ranges zero to 07FFFH and 0A000H to 0AFFFH.

The /ROM option is also used to specify switchable code banks.  The code bank number is appended to the end as follows

/ROM:[low address]:[high address]:[bank number]

Bank number may be between 0 and 255 and should correspond with the bank number used the SECTION assembler directive.

For example:

/ROM:B000:FFFF:0 /ROM:B000:FFFF:1 /ROM:B000:FFFF:2

tells the linker that three code banks numbered zero, one and two exist each with an address range of 0B000H to 0FFFFH.