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

声明:

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

2、请勿用于商业用途。

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

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

ROM Compiler Directive

Abbreviation

None.

Arguments

(SMALL), (COMPACT), (LARGE), (D512K), or (D16M)

Default

ROM (LARGE)

µVision

Options — Target — Code ROM Size.

Description

You use the ROM directive to specify the size of the program memory. This directive affects the coding of the JMP and CALL instructions.

Option Description
SMALL CALL and JMP instructions are coded as ACALL and AJMP. The maximum program size may be 2 KBytes. The entire program must be allocated within the 2 KByte program memory space.
COMPACT CALL instructions are coded as LCALLJMP instructions are coded asAJMP within a function. The size of a function must not exceed 2 KBytes. The entire program may, however, comprise a maximum of 64 KBytes. The type of application determines whether or not ROM (COMPACT) is more advantageous than ROM (LARGE). Any code space saving advantages in using ROM (COMPACT) must be empirically determined.
LARGE CALL and JMP instructions are coded as LCALL and LJMP. This allows you to use the entire address space without any restrictions. Program size is limited to 64 KBytes. Function size is also limited to 64 KBytes.
D512K
(Dallas 390& variants)
19-bit ACALL and AJMP instructions are generated. The maximum program size may be 512 KBytes. This mode is available only for the Dallas 390 and compatible devices.
D16M
(Dallas 390& variants)
24-bit LCALL instructions and 19-bit AJMP instructions are generated. The maximum program size may be 16MBytes. This mode is available only for the Dallas 390 and compatible devices.

 Note

  • The D512K and D16M options require the OMF2 directive.
See Also

COMPACTLARGESMALL

Example
C51 SAMPLE.C ROM (SMALL)

#pragma ROM (SMALL)


ROM 编译器伪指令

缩写

无。

参数

(SMALL), (COMPACT), (LARGE), (D512K), or (D16M)

缺省

ROM (LARGE)

µVision

Options — Target — Code ROM Size.

描述

用户指定 ROM 伪指令指定程序存储器的大小。这个伪指令影响JMP 和 CALL 指令的代码。

Option Description
SMALL CALL 和 JMP 指令编码为 ACALL 和 AJMP. 最大的程序代码为 2 K字节。整个程序必须分配在  2 K字节的程序存储器空间。
COMPACT CALL 指令编码为 LCALLJMP 编码为AJMP 。 函数的大小不能超过2 K字节。 但是整个程序最大到64 K字节。应用程序的类型决定 ROM (COMPACT) 是否比 ROM (LARGE)更有利。使用 ROM (COMPACT) 节省代码的优势必须根据经验决定。
LARGE CALL 和 JMP 指令编码为 LCALL 和 LJMP。这允许用户没有如何限制地使用这个地址空间。程序大小限制在64 K字节,函数大小也限制在64 K字节。
D512K
(Dallas 390& variants)
生成19-bit ACALL和 AJMP 指令。 最大的程序大小为 512 K字节。 这个模式只对Dallas 390 和兼容器件有效。
D16M
(Dallas 390& variants)
生成24-bit LCALL 指令和 19-bit AJMP 指令。 最大的程序大小为 16M字节。这个模式只对 Dallas 390 和兼容器件有效。

 注意

  • D512K 和 D16M 选项需要 OMF2 伪指令。
参考

COMPACTLARGESMALL

示例
C51 SAMPLE.C ROM (SMALL)

#pragma ROM (SMALL)



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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值