Jump to main content
MPLAB® XC16 C Compiler User Guide
MPLAB® XC16 C Compiler User Guide
  1. Home
  2. 5 How To's
  3. 5.3 Writing Source Code
  4. 5.3.3 Memory Allocation

  • Notice to Development Tools Customers
  • 1 Preface
  • 2 Compiler Overview
  • 3 Compiler and Other Development Tools
  • 4 Common C Interface
  • 5 How To's
    • 5.1 Installing and Activating the Compiler
    • 5.2 Invoking the Compiler
    • 5.3 Writing Source Code
      • 5.3.1 C Language Specifics
      • 5.3.2 Device-Specific Features
      • 5.3.3 Memory Allocation
        • 5.3.3.1 How Do I Position Variables or Functions at an Address I Nominate?
        • 5.3.3.2 How Do I Place Variables in Program Memory?
        • 5.3.3.3 How Do I Allocate Space for a Variable But Not Initialize/Load Any Value?
        • 5.3.3.4 How Do I Stop the Compiler From Using Certain Memory Locations?
      • 5.3.4 Variables
      • 5.3.5 Functions
      • 5.3.6 Interrupts
      • 5.3.7 Assembly Code
    • 5.4 Getting My Application to Do What I Want
    • 5.5 Understanding the Compilation Process
    • 5.6 Fixing Code That Does Not Work
  • 6 XC16 Toolchain and MPLAB X IDE
  • 7 Compiler Command-Line Driver
  • 8 Device-Related Features
  • 9 Differences Between MPLAB XC16 and ANSI C
  • 10 Supported Data Types and Variables
  • 11 Fixed-Point Arithmetic Support
  • 12 Memory Allocation and Access
  • 13 Operators and Statements
  • 14 Register Usage
  • 15 Functions
  • 16 Interrupts
  • 17 Main, Runtime Startup and Reset
  • 18 Mixing C and Assembly Code
  • 19 Library Routines
  • 20 Optimizations
  • 21 Preprocessing
  • 22 Linking Programs
  • 23 Implementation-Defined Behavior
  • 24 Embedded Compiler Compatibility Mode
  • 25 Diagnostics
  • 26 GNU Free Documentation License
  • 27 Deprecated Features
  • 28 Built-in Functions
  • 29 Document Revision History
  • The Microchip Website
  • Product Change Notification Service
  • Customer Support
  • Product Identification System
  • Microchip Devices Code Protection Feature
  • Legal Notice
  • Trademarks
  • Quality Management System
  • Worldwide Sales and Service

5.3.3 Memory Allocation

These questions relate to the way in which your source code affects memory allocation.

  • How Do I Position Variables or Functions at an Address I Nominate?
  • How Do I Place Variables in Program Memory?
  • How Do I Allocate Space for a Variable But Not Initialize/Load Any Value?
  • How Do I Stop the Compiler From Using Certain Memory Locations?

The online versions of the documents are provided as a courtesy. Verify all content and data in the device’s PDF documentation found on the device product page.

Microchip Facebook
Microchip LinkedIn
Microchip Twitter
Microchip YouTube
Microchip Instagram
Microchip Weibo
Microchip Blog
Contact |
Legal |
Privacy Policy |
Cookies |
Careers

Stay on the leading edge with our blog

MicroSolutions

© Copyright 1998-2022 Microchip Technology Inc. All rights reserved.