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

製品コード
SW006021-1
ページ / 518
MPLAB
®
 XC8 C Compiler User’s Guide
DS52053B-page 196
 2012 Microchip Technology Inc.
The psects used for storing these components are described in 
Section 5.15.2 “Compiler-Generated Psects” and typically have a name based on 
the initialism “bss” (Block Started by Symbol).
The runtime startup code will clear all the memory location occupied by uninitialized 
variables so they will contain zero before main() is executed.
Variables whose contents should be preserved over a Reset should be qualified with 
persistent
. See Section 5.4.8.1 “Persistent Type Qualifier” for more information. 
Such variables are linked at a different area of memory and are not altered by the 
runtime startup code in any way.
If objects are initialized, the runtime startup code that performs this will destroy the con-
tents of the STATUS register. With some devices, the TO and PD bits in this register 
are required to determine the cause of Reset. You can choose to have a copy of this 
register taken so that it can later be examined. See Section 5.10.1.4 “STATUS Reg-
ister Preservation”
 for more information.
5.10.1.3
OSCILLATOR CALIBRATION
Some PIC devices come with an oscillator calibration constant which is pre-pro-
grammed into the device’s program memory. This constant can be written to the OSC-
CAL register to calibrate the internal RC oscillator, if required.
Code is automatically placed in the runtime startup code to load this calibration value, 
see Section 5.3.9.1 “Oscillator Calibration Constants”.