AnsweredAssumed Answered

I Get Wrong Function Address

Question asked by everk image on Oct 10, 2019
Latest reply on Oct 12, 2019 by everk image

My mcu is MC9S12X.

 

In the map file,my two functions address are:

function_1 : 0x616E

function_2 : 0x527C

 

But when i use codes below to get the function address,the result always shift left 8bit:

volatile unsigned long addr_1, addr_2;

addr_1 = (unsigned long)function_1;

addr_2 = (unsigned long)function_2;

 

addr_1 == 0x616E00;

addr_2 == 0x527C00;

why?

Outcomes