CX51 用户手册----SMALL伪指令

来源:互联网 发布:java在线api 编辑:程序博客网 时间:2024/06/04 01:25

声明:

1、本翻译仅供个人学习使用,本人没有提供技术支持的义务,也不承担由此引发的任何后果。

2、请勿用于商业用途。

3、英文来自:http://www.keil.com/support/man/docs/c51/。

4、欢迎大家共同与我交流探讨(290207203@qq.com)。

SMALL Compiler Directive

Abbreviation

SM

Arguments

None.

Default

SMALL

µVision

Options — Target — Memory Model.

Description

This directive selects the SMALL memory model that places all function variables and local data segments in the internal data memory of the 8051 system. This allows very efficient access to data objects. The address space of the SMALL memory model, however, is limited.

Regardless of memory model type, you may declare variables in any of the 8051 memory ranges. However, placing frequently used directives (such as loop counters and array indices) in internal data memory significantly improves system performance.

 Note

  • The stack required for function calls is always placed in IDATA memory.
  • Always start by using the SMALL memory model. Then, as your application grows, you can place large variables and data in other memory areas by explicitly declaring the memory area with the variable declaration.
See Also

COMPACTLARGEROM

Example
C51 SAMPLE.C SMALL#pragma small

 Related Knowledgebase Articles

  • C251: SMALL DIRECTIVE


SMALL 编译器伪指令

缩写

SM

参数

无。

缺省

SMALL

µVision

Options — Target — Memory Model.

描述

这个伪指令选择 SMALL 存储器模型,所有的函数变量和局部数据段放在8051系统的内部数据段。这可以有效地访问数据对象。但是使用SMALL 存储器模型的地址空间有限。

不管存储器模型的类型,用户可以在8051的任意存储器范围内声明变量。但是把频繁使用的变量 (例如循环计数器和数组索引) 放在内部数据存储器可以有效地提高系统性能。

 注意

  • 函数调用需要的栈总是保存在 IDATA 存储器中。
  • 总是使用 SMALL 存储器模型开始,然后,随着应用程序的增长,在函数声明时显示地声明存储器区域,用户可以把大量的变量和数据放在其他存储器区域。
参考

COMPACTLARGEROM

示例
C51 SAMPLE.C SMALL#pragma small

 相关知识库标题

  • C251: SMALL DIRECTIVE



原创粉丝点击