"@" symbol addressing

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

"@" symbol addressing

750 次查看
JaseMachine
Contributor I

Hi, I'm having trouble finding any information on the use of the "@" symbol to provide a specific address for a variable as it is used in the provided header. Is there some reference material that describes its properties in detail?

标签 (1)
标记 (1)
0 项奖励
回复
3 回复数

568 次查看
CrasyCat
Specialist III

Hello

 

  - Which CPU are you targeting (HC08, HC12, Coldfire, ..)
  - Which version of CodeWarrior are you using?

  As far as I know @ modifier to allocate a variable at a specific address is supported on HCS08 and Coldfire V1 only.

 

  It is documented in MCU_HCS08_Compiler.pdf. There is a section called "Global Variable Address Modifier (@address)".

 

 

CrasyCat

0 项奖励
回复

568 次查看
JaseMachine
Contributor I

Thank you! Sorry I didn't mention I was using the HC08 and MCF51QE with both v6 and v10 Codewarrior (migrating). I tried looking in the Coldfire compiler reference and returned no results, thanks for pointing me to the HC08 reference. 

0 项奖励
回复

568 次查看
FridgeFreezer
Senior Contributor I

It works fine for me in CW7.2 for CFV2 (MCF52259), as seen in Freescale's own bootloader example:

//***********************************************// User Entry vectors for bootloader#include "bootloader.h"extern asm void asm_startmeup(void);const uint8 _UserEntry[] @ USER_ENTRY_ADDRESS = {  0x4E,  0x71,  //asm NOP(0x4E71)  0x4E,  0xF9  //asm JMP(0x4EF9)           };void  (* const _UserEntry2[])()@(USER_ENTRY_ADDRESS+4)={  asm_startmeup,};

 

0 项奖励
回复