code 顺序的变化是不会影响代码的
- code
- The code memory type may be used for constants and functions. This memory is accessed using 16-bit addresses and may be on-chip or external.
- For constants (ROM variables), code memory is limited to 64K. Objects are limited to 64K and may not cross a 64K boundary. Constant variables declared code are located in the CODE memory class.
- For program code (functions), code memory is limited to 64K. Program functions are stored in the CODE memory class by default. The code memory type specifier is not required.
- Declare code objects as follows:
- unsigned char code code_constant;
- unsigned int func (void)
- {
- return (0);
- }
- ============================================
- The Cx51 Compiler conforms to the ANSI definition of const objects.
- Variables declared with the const type qualifier alone are stored in the memory area (data, idata, xdata, and so on) associated with their definition.
- Variables you want to locate in ROM must be declared with the code memory type. For example:
- code char test[] = "This is a text string";
复制代码
|