使用KEIL C BL51 中,code分配的指令

CODE Linker Directive

Abbreviation

CO

Arguments

CODE (〚range〛 〚segment 〚(address)〛 〚, ...〛〛)

Default

None.

µVision

Options — BL51 Locate — Code Range.
Options — BL51 Locate — Code Segments.

Description

The CODE directive specifies:

  • The address range for relocatable CODE segments.
  • The order of relocatable CODE segments in memory.
  • The absolute memory location of individual CODE segments.

This directive is specified as follows:

CODE (〚range, ...〛 〚segment 〚(address)〛 〚, ...〛〛)

Where

rangespecifies the address range(s) to use for CODE segments.
segmentis the name of a segment.
addressis a physical address at which the segment is to be located.

Note

  • The BL51 Linker allows you to use wildcards when locating program segments. For example, ?PR?*?MYFILE may be used to represent all program segments from the MYFILE source file.
See Also

BIT, DATA, IDATA, PDATA, PRECEDE, RAMSIZE, STACK, XDATA

Example

The example below specifies that relocatable CODE segments be located in the address space 0 – 0x3FFF and 0x8000 – 0xFFFF:

BL51 MYPROG.OBJ CODE(0 - 0x3FFF, 0x8000 - 0xFFFF)

To specify the order for segments, you must include the names of the segments separated by commas. The following example will place the ?PR?FUNC1?A and ?PR?FUNC2?A segments at the beginning of the CODE memory:

BL51 A.OBJ CODE(?PR?FUNC1?A, ?PR?FUNC2?A)

You can also specify the memory location for a segment. The example below will place the ?PR?FUNC1?A segment at 800h and the ?PR?FUNC2?A segment after at this segment:

BL51 A.OBJ CODE(?PR?FUNC1?A (0x800), ?PR?FUNC2?A)
 
reference: http://www.keil.com/support/man/docs/bl51/bl51_code.htm
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值