Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 ユーザーズマニュアル

製品コード
SW006021-1
ページ / 518
XC8 Command-line Driver
 2012 Microchip Technology Inc.
DS52053B-page 111
4.8.48
--RAM: Adjust RAM Ranges
This option is used to adjust the default RAM, which is specified for the target device. 
The default memory will include all the on-chip RAM specified for the target 
PIC10/12/16 device, thus this option only needs be used if there are special memory 
requirements. Typically this option is used to reserve memory (reduce the amount of 
memory available). Specifying additional memory that is not in the target device will 
typically result in a successful compilation, but may lead to code failures at runtime.
The default RAM memory for each target device is specified in the chipinfo file, 
PICC18.INI
 (for PIC18 devices) or PICC.INI (for all other 8-bit devices).
Strictly speaking, this option specifies the areas of memory that may be used by writ-
able (RAM-based) objects, and not necessarily those areas of memory which contain 
physical RAM. The output that will be placed in the ranges specified by this option are 
typically variables that a program defines.
For example, to specify an additional range of memory to that already present on-chip, 
use:
--RAM=default,+100-1ff
This will add the range from 100h to 1ffh to the on-chip memory. To only use an external 
range and ignore any on-chip memory, use:
--RAM=0-ff
This option may also be used to reserve memory ranges already defined as on-chip 
memory in the chipinfo file. To do this, supply a range prefixed with a minus character, 
-
, for example:
--RAM=default,-100-103
will use all the defined on-chip memory, but not use the addresses in the range from 
100h to 103h for allocation of RAM objects.
This option is also used to specify RAM for far objects on PIC18 devices. These 
objects are stored in the PIC18 extended memory. Any additional memory specified 
with this option whose address is above the on-chip program memory is assumed to 
be extended memory implemented as RAM.
For example, to indicate that RAM has been implemented in the extended memory 
space at addresses 0x20000 to 0x20fff, use the following option.
--RAM=default,+20000-20fff
This option will adjust the memory ranges used by linker classes, see 
Section 7.2.1 “-Aclass =low-high,...”, and hence any object which is in a psect is 
placed in this class. Any objects contained in a psect that are explicitly placed at a 
memory address by the linker (see Section 7.2.19 “-Pspec”) i.e., are not placed into 
a memory class, are not affected by the option. For an introductory guide to psects, see 
Section 5.15.1 “Program Sections”.