ROM_4000 & option: -OnB=b

Showing results for 
Search instead for 
Did you mean: 

ROM_4000 & option: -OnB=b

Contributor III


We have some projects that use mc9s12dg256, mc9s12xdt512 and mc9s12xeq512 controllers.

In the ROM area 4000, are stored data that are device configuration parameters.

All data in ROM 4000 are accessible through pointers.


004000'L   00 18 06 ED 0B 94 10 3B ....

the pointer for ROM 4000:

const struct Index_Struct
   unsigned int General_Param;
   unsigned int Keyboard;
   unsigned int Fonts;
}* const Index = (const struct Index_Struct *) (0x7F4000);

The data are accessible through the pointer:

Fonts_Address = (*Index).Fonts;

Key_Address = (*Index).Keyboard;

According to the data sheet, if ROM 4000 is used, we have to compile the project with option: -OnB=b.

In this case the ROM 4000 is used only for constant data, no firmware is located.

Should we compile the project with option: -OnB=b?

I am asking because our projects use the ROM 4000 for constant data, we do not use this option but the projects works properly.

Thank you

0 Kudos
1 Reply

NXP TechSupport
NXP TechSupport


  -OnB=b Disable Branch JSR to BSR optimization. The "Branch JSR to BSR Optimization" uses a BSR instead of a JSR to call a function, if the offset is small enough and known at compilation time.

The difference of JSR and BSR is the way they call functions. If your code doesn't related with function call, personally I think -OnB=b is not necessary.

But I strongly recommend you follow the suggestion of CW ROM 4000 usage to add  -OnB=b. It's no harm.

Have a great day,

- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.

0 Kudos