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 program code. 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. These values will be used in the absence of any /ROM directive.
An example directive is:
This will cause the linker to place program code in the address range zero to 0X7FFF.
Multiple /ROM directives can be used to specify discontinuous regions of rom. For example:
tells the linker to use address ranges zero to 0X7FFF and 0XA000 to 0XAFFF.
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 0XFF and should correspond with the bank number used with the bank pragma in your C source code or with the SEGMENT assembler directive.
/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 0XB000 to 0XFFFF.