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

本文详细介绍了SMALL伪指令在8051系统的应用。该指令选择SMALL存储器模型,将所有函数变量和局部数据段置于内部数据内存中,以此实现高效的数据访问。然而,该模型的地址空间有限制,适用于小型程序。文章还提供了如何根据程序需求调整变量存储位置的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

声明:

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



SMALL 编译器伪指令

缩写

SM

参数

无。

缺省

SMALL

µVision

Options — Target — Memory Model.

描述

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

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

 注意

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

COMPACTLARGEROM

示例
C51 SAMPLE.C SMALL

#pragma small

 相关知识库标题




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值