嵌入式中的存贮位置关键字
来源:互联网 发布:2016年淘宝生意很差 编辑:程序博客网 时间:2024/05/05 00:41
The Cx51 Compiler provides access to all 8051 memory areas. Variables may be explicitly assigned to a specific memory space (by including a memory type specifier in the declaration) or implicitly assigned (based on the memory model).
The following table summarizes the memory type specifiers you may use.
Memory Type | Description |
---|---|
code | Program memory (64 KBytes); accessed by opcode MOVC @A+DPTR. |
data | Directly addressable internal data memory; fastest access to variables (128 bytes). |
idata | Indirectly addressable internal data memory; accessed across the full internal address space (256 bytes). |
bdata | Bit-addressable internal data memory; supports mixed bit and byte access (16 bytes). |
xdata | External data memory (64 KBytes); accessed by opcode MOVX @DPTR. |
far | Extended RAM and ROM memory spaces (up to 16MB); accessed by user defined routines or specific chip extensions (Philips 80C51MX, Dallas 390). |
pdata | Paged (256 bytes) external data memory; accessed by opcode MOVX @Rn. |
As with the signed and unsigned attributes, you may include memory type specifiers in the variable declaration. For example:
char data var1;char code text[] = "ENTER PARAMETER:";unsigned long xdata array[100];float idata x,y,z;unsigned int pdata dimension;unsigned char xdata vector[10][4][4];char bdata flags;
Note
For compatibility with previous versions of the C51 Compiler, you may specify the memory area before the data type. For example, the following two declarations are equivalent:
data char x; // Old-Style Memory Type Declarationchar data x; // New-Style Memory Type Declaration
Nonetheless, this feature should not be used in new programs because it may not be supported in future versions of the Cx51 Compiler. Be careful when using the old C51 syntax with memory-specific pointers. For example, the following two declarations are equivalent:
data char *x; // Old-Style Memory Type Declarationchar *data x; // New-Style Memory Type Declaration
- Accessing the internal data memory is considerably faster than accessing the external data memory. For this reason, place frequently used variables in internal data memory. Place larger, less frequently used variables in external data memory.
If no memory type is specified for a variable, the compiler implicitly locates the variable in the default memory space determined by the memory model: SMALL, COMPACT, or LARGE. Function arguments and automatic variables that cannot be located in registers are also stored in the default memory area. Refer to Memory Models for more information.
- 嵌入式中的存贮位置关键字
- 根据关键字搜索的一个存贮过程
- 嵌入式系统中的位置无关代码
- 嵌入式C语言中的volatile关键字
- 嵌入式C语言中的volatile关键字
- 嵌入式C语言中的volatile关键字。
- 嵌入式C语言中的volatile关键字
- 关键字-嵌入式
- 虚拟存贮技术在信息管理中的意义
- Python 中的位置参数和关键字参数分析
- 查询存贮在表中的XML的结点值。
- 使用指针递增存贮在其他变量中的值
- 关键字位置问题
- 嵌入式volatile关键字
- 嵌入式volatile关键字
- static关键字的特点之——类静态成员变量在内存中的位置
- static关键字的特点之——类静态成员变量在内存中的位置
- ibatis web嵌入式数据库文件位置
- 支持
- ArrayList用法
- [原创图解]Win2003证书服务配置/客户端(服务端)证书申请/IIS站点SSL设置
- ASP.NET程序中常用的代码
- 居家过日子,能省就省-----FlyWeight享元模式
- 嵌入式中的存贮位置关键字
- memset函数
- oracle 语法总结
- ORACLE的数据类型
- 清除WORD格式HTML垃圾样式
- ManualResetEvent,AutoResetEvent类线程同步
- String.Format格式说明
- (转贴)浅析GSM上层协议及其在测试中的应用
- vs2008版本