Special keywords...

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Special keywords...

1,455件の閲覧回数
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 返信

921件の閲覧回数
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 件の賞賛
返信