Switch statement & Table of Funciont Pointers (short)

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

Switch statement & Table of Funciont Pointers (short)

ソリューションへジャンプ
2,058件の閲覧回数
SebaS
Contributor III
I've got this code at Page 38

switch(x){
..
..
..
..
}

but I don't know why _CASE_CHECKED (the procedure used by the switch statement) is at another page (PAGE 3C) so it don't work.

The compiler transform the switch into some assembly code with a JSR to _CASE_CHECKED, but since _CASE_CHECKED is in different page, that jump is wrong. It should be a CALL, but it's a JSR..... how can i fix that?

Thanks in advance....

For more info check the longer version:
http://forums.freescale.com/freescale/board/message?board.id=CWCOMM&message.id=3381
ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
1,187件の閲覧回数
SebaS
Contributor III
Thanks a lot!!! Now it's working!!!

I modified the .PRM file and I add this:

NON_BANKED INTO PAGE_C000

and now it's working...... I remember when I first create this project... this line were ther but I deleted because at that page I put the interrupts and I was afraid that would reduce the amount of code at that page.

THANKS!!! especially because you answer really fast!!

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,187件の閲覧回数
CrasyCat
Specialist III
Hello
 
How did you create your project?
I highly recommend you to create your project using the project wizard and specifying you want to build for banked memory model.
 
This will ensure you are using the appropriate ansi library file and .prm file.
basically when you are building for BANKED memory model, the run time functions (and _CASE_CHECKED is one of those run time functions) are defined in a section called NON_BANKED.
 
According to its name that section MUST be placed in non banked flash.
If you did not start with the appropriate configuration you may face other such issues.
I would really recommend that you create a brand new project using the  project wizard and specifying the appropriate configuration.
 
You will save yourself a lot of pain and time this way.
 
CrasyCat
0 件の賞賛
返信
1,188件の閲覧回数
SebaS
Contributor III
Thanks a lot!!! Now it's working!!!

I modified the .PRM file and I add this:

NON_BANKED INTO PAGE_C000

and now it's working...... I remember when I first create this project... this line were ther but I deleted because at that page I put the interrupts and I was afraid that would reduce the amount of code at that page.

THANKS!!! especially because you answer really fast!!
0 件の賞賛
返信