Special keywords...

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

Special keywords...

1,380 次查看
Iko
Contributor II

Hi all.

i'm working on a MC9S08DZ60

 

I'll try to find somethings about special keyword :

 

-to write in internal RAM

-to write in internal ROM

-to write in internal FLASH

-to write in internal EEPROM

 

I have saw something like "const var in rom" in the *.prm file... but i don't know...

 

Could you help me to find a good way to do this?

 

Ty all ^^

标签 (1)
0 项奖励
回复
1 回复

846 次查看
CrasyCat
Specialist III

Hello

 

What exactly are you trying to achieve here?

There is no dedicated keyword to place something in RAM, FLASH or EEPROM.

 

Basically on the compiler side you specify in which section you want to place a variable and then in your linker.PRM file you place the section in the appropriate memory area.

 

Per default

    - constant variables are placed in .rodata (variable defined with const).

    - string constants in .rodata1.

    - global variables defined with an initialization value are placed in .data

   -  global variables defined without initialization value are placed in .bss

 

You can define your own section using the #pragma DATA_SEG or #pragma CONST_SEG to specify alternate sections.

Then all you need to do is place the sections accordingly in the .PRM file.

 

CrasyCat

0 项奖励
回复