- FAE/Client Login
- product registration
- > Download <
- Our products
- Support
- FAQs
- technical support
- Installation
- Application Notes
- Device List
- Hints and Tips
- C38 - Special Page Access
- C6805 - Filling Unused ROM
- C6805 - Setting Multiple MORs
- C6805 - Working with MMEVS05/MMDS05
- C6808 and Emulators
- COP8C - Executing Initialization Code
- COP8C - S Register Support
- Debugging: Using Macros to Monitor Program Flow
- Declaring SPECIAL Memory
- LCD Interface
- LOCAL Memory
- Low Cost, Low Speed A/D conversion for Embedded Systems
- MPC - Branch Islands on the PIC16C5x
- MPC - Constant ROM Arrays
- MPC - Named Address Space
- MPC - Setting Configuration Fuses
- Non-linear Data Transformations
- Using the CodeWright(TM) Editor
- Product-specific Notes
- Resources
- CODSupport
- Fixed Point
- Fuzzy Logic
- Publishing
- What's New
- About Us
- more information
LOCAL Memory
local
Byte Craft compilers determine all variable locations at compile time. The
#pragma memory LOCAL [size] @location;
directive allows the compiler to reuse this space for local variable storage.
LOCAL memory availability changes the way the compiler generates code for function calls. The compiler will pass any number of parameters into a function, using LOCAL memory to store the passed-in values. Without LOCAL memory, the compiler will only pass two bytes (or one 16-bit word) through parameters, requiring you to pass other values through global variables.
If size is given as 0, the compiler determines the amount of space needed, and only allocates as much as necessary. If size is specified, the compiler will not reclaim unused LOCAL space for global variables.
The If size is given as 0, the compiler builds LOCAL memory down from location. If a size other than 0 is specified, the compiler starts at location and allocates size bytes, going up.
The size of local variable space may be architecturally-restricted depending on the target controller.
#pragma memory LOCAL [0] @0x7f;
long term1, term2, term3;
long sum(long a, long b, long c)
{
return (a+b+c);
}
void main(void){
long result;
term1=1;
term2=6;
term3=0;
result=sum(term1,term2,term3);
}

eTPU_C:
C6808: