Mikroelektronika MIKROE-742 데이터 시트

다운로드
페이지 532
MEMORY TYPE SPECIFIERS
The mikroPascal PRO for AVR supports usage of all memory areas. Each variable may be explic-
itly assigned to a specific memory space by including a memory type specifier in the declaration,
or implicitly assigned. 
The following memory type specifiers can be used:
- code 
- data 
- rx 
- io 
- sfr 
Memory type specifiers can be included in variable declaration. 
For example:
var data_buffer : char; data;
// puts data_buffer in data ram
const txt = 'Enter parameter'; code; // puts text in program memory
code
data
rx
114
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
AVR Specifics
mikroPASCAL PRO for AVR
CHAPTER 4
Description
The 
code
memory type may be used for allocating constants in program memory.
Example
// puts txt in program memory 
const txt = 'Enter parameter'; code;
Description
This memory specifier is used when storing variable to the internal data SRAM.
Example
// puts data_buffer in data ram
var data_buffer : char; data;
Description
This memory specifier allows variable to be stored in the Rx space (Register file).
Note: In most of the cases, there will be enough space left for the user variables
in the Rx space. However, since compiler uses Rx space for storing temporary
variables, it might happen that user variables will be stored in the internal data
SRAM, when writing complex programs. 
Example
// puts y in Rx space  
var y : char; rx;