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

声明:

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

2、请勿用于商业用途。

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

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

OBJECTADVANCED Compiler Directive

Abbreviation

OA

Arguments

None.

Default

None.

µVision

Options — C51 — Code Optimization — Linker Code Packing.

Description

The OBJECTADVANCED directive instructs the compiler to include information in the object file for linker-level program optimizations. This directive is used with the OPTIMIZEdirective to shrink program size and decrease execution speed.

When enabled, the OBJECTADVANCED directive instructs the LX51 Linker/Locator to perform the following optimizations:

OPTIMIZE
Level
Linker Optimizations
Performed
0 – 7 AJMP/ACALL Maximizing: The linker rearranges code segments to maximize AJMP and ACALL instructions which are shorter than LJMP andLCALL instructions.
8 Reuse of Common Entry Code: Setup code may be reused when multiple calls are made to a single function. Reusing common entry code reduces program size. This optimization is performed on the complete application.
9 Common Block Subroutines: Recurring instruction sequences are converted into subroutines. This reduces program size but slightly increases execution speed. This optimization is performed on the complete application.
10 Rearrange Code: When detecting common block subroutines, code is rearranged to obtain larger recurring sequences.
11 Reuse of Common Exit Code: Identical exit sequences are reused. This may reduce the size of common block subroutines even further. This optimization level generates the most compact program code possible.
See Also

OPTIMIZE

Example
C51 SAMPLE.C OBJECTADVANCE DEBUG


OBJECTADVANCED 编译器伪指令

缩写

OA

参数

无。

缺省

无。

µVision

Options — C51 — Code Optimization — Linker Code Packing.

描述

OBJECTADVANCED 伪指令告诉编译器在生成的目标文件中包含链接级的程序优化信息。这个伪指令和OPTIMIZE伪指令一起使用,缩小程序大小,降低执行速度。

当使能, OBJECTADVANCED 伪指令告诉 LX51链接器/定位器实现下面的优化: 

优化级别 链接器实现优化
0 – 7 AJMP/ACALL 最大化: 链接器重新安排代码段,最大限度地使用 AJMP 和 ACALL 指令, 它们比 LJMP 和LCALL 指令的跳转范围短。
8 重复使用公共入口代码: 当单个函数多次调用设置代码时,设置代码可以重复使用。重复使用公共入口代码降低程序大小。 全部应用程序实现这个优化。
9 公共块子程序: 循环指令序列被转换为子程序。这降低了程序代码,但增加了执行速度。全部应用程序实现这个优化。
10 重新安排代码: 当检测到公共块子程序,重新安排代码,以获得更大的循环序列。
11 重复使用公共退出代码: 相同的退出序列重复使用。这可以进一步地降低公共块子程序的大小。这个优化级别尽可能地生成最紧凑的代码。 
参考

OPTIMIZE

示例
C51 SAMPLE.C OBJECTADVANCE DEBUG



  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值