Special keywords...

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Special keywords...

825 Views
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 ^^

Labels (1)
0 Kudos
1 Reply

291 Views
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 Kudos