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

声明:

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

2、请勿用于商业用途。

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

4、欢迎大家共同与我交流探讨([email protected])。

MOD517 Compiler Directive

Abbreviation

None.

Arguments

Optional parameters, enclosed in parentheses, to control support for individual components of the 80C517.

Default

NOMOD517

µVision

Options — Target — Use On-Chip Arithmetic Unit.
Options — Target — Use multiple DPTR registers.

Description

The MOD517 directive instructs the Cx51 Compiler to produce code for the additional hardware components (the arithmetic processor and the additional data pointers) of the Infineon C517 or variants. This feature improves the performance of integer, long, and floating-point math operations, as well as functions that make use of the additional data pointers (memcpymemmovememcmpstrcpy, and strcmp).

Library functions that take advantage of the arithmetic processor have a 517 suffix. Refer to the Library Reference for details on these functions.)

Additional parameters may be specified with the MOD517 directive to control the Cx51 Compiler support of the individual components of the Infineon device. When specified, the parameters must appear within parentheses immediately following the MOD517 directive. Parentheses are not required if no additional parameters are specified.

Directive Description
NOAU When specified, the Cx51 Compiler uses only the additional data pointers of the Infineon device. The arithmetic processor is not used. The NOAUparameter is useful for functions that are called by an interrupt while the arithmetic processor is already being used.
NODP8 When specified, the Cx51 Compiler uses only the arithmetic processor. The additional data pointers are not used. The NODP8 parameter is useful for interrupt functions declared without the using function attribute. In this case, the extra data pointers are not used and, therefore, do not need to be saved on the stack during the interrupt.

Specifying both of these additional parameters with MOD517 has the same effect as using the NOMOD517 directive.

 Note

  • Although it may be specified several times in a source file, the MOD517 directive is valid only when defined outside of a function declaration.
  • The Infineon C517 uses the DPSEL SFR to select the DPTR register. On the Evatronix R8051XC Core the same register has the name DPS. Evatronix also offers the BSE(Bank Switch Enable) for automatic DPTR selection with register bank switches.
  • On Infineon C517 devices, the DPSEL SFR is located at address 0x92. However, some devices (like the Mentor M8051EW) locate DPSEL at a different address.

    The address for DPSEL is stored in a public symbol and may be changed by adding the following to an assembler source file like STARTUP.A51:
    PUBLIC ?C?DPSEL
    ?C?DPSEL DATA 0A2H   ; DPSEL address for Mentor M8051EW
    
See Also

BSENOMOD517

Example
C51 SAMPL517.C  MOD517

#pragma MOD517 (NOAU)

#pragma MOD517 (NODP8)

#pragma MOD517 (NODP8, NOAU)

 Related Knowledgebase Articles

  • C51: MOD517/ NOMOD517 DIRECTIVE
  • C51: SUPPORT FOR THE 515C EIGHT DATA POINTERS


MOD517 编译器伪指令

缩写

无。

参数

参数选项,用括号括起来,控制80C517器件的独立组件的支持。

缺省

NOMOD517

µVision

Options — Target — Use On-Chip Arithmetic Unit.
Options — Target — Use multiple DPTR registers.

描述

MOD517 伪指令告诉Cx51 编译器为Infineon C517或变体的附件硬件(算术处理器以及附件的数据指针)生成代码。这个特性提高整型,长整型以及浮点型数学操作以及使用附件数据指针的函数(memcpymemmovememcmpstrcpy, 和 strcmp)的性能。

使用算术处理器的库函数有 517 前缀。这些函数的细节参考  库引用。

MOD517 伪指令指定的附件参数用来控制Cx51 编译器支持 Infineon 器件的附加组件。 一旦指定,参数必须用括号括起来。如果不需要附加参数,就不需要括号。

参数       描述
NOAU 当指定时, Cx51 仅使用 Infineon器件的附加数据指针,不使用算术处理器。NOAU参数对被中断(当前算术处理器正在被使用)调用的函数很有用。
NODP8 当指定时, Cx51 仅使用 Infineon器件的算术处理器不使用附加数据指针NODP8 参数对没有使用函数属性声明的中断函数很有用。在这种情况下,额外的数据指针没有使用,所以,在中断中不需要把它们保存到栈中。

用 MOD517 同时指定这两个参数和NOMOD517 伪指令效果一样。

 注意

  • 尽管 MOD517 伪指令可以在源文件中指定多次,但仅当定义在函数声明的外面时有效。
  • Infineon C517 使用 DPSEL特殊功能寄存器选择 DPTR。 在Evatronix R8051XC 核中,相同的特殊功能寄存器名是DPS. Evatronix 也提供 BSE(Bank Switch Enable), 在进行寄存器组切换时,自动选择 DPTR 。
  • 对Infineon C517 器件,DPSEL 地址是 0x92但有些器件 (象 Mentor M8051EW)  DPSEL 地址定位在不同的地方。

    DPSEL 的地址存储在一个公共符号上,可以通过下面的汇编源文件(象STARTUP.A51)改变:
    PUBLIC ?C?DPSEL
    ?C?DPSEL DATA 0A2H   ; DPSEL address for Mentor M8051EW
    
参考

BSENOMOD517

示例
C51 SAMPL517.C  MOD517

#pragma MOD517 (NOAU)

#pragma MOD517 (NODP8)

#pragma MOD517 (NODP8, NOAU)

 相关知识库标题

  • C51: MOD517/ NOMOD517 DIRECTIVE
  • C51: SUPPORT FOR THE 515C EIGHT DATA POINTERS




你可能感兴趣的:(51,pointers,parameters,compiler,components,reference,编译器)