Problem with pointer to unsigned long in S12XEP100 with Banked Memory model

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

Problem with pointer to unsigned long in S12XEP100 with Banked Memory model

ソリューションへジャンプ
1,363件の閲覧回数
sep2kor
Contributor III

Hi,

 

I am using code warrior for S12XEP100 target.

 

I am having problem with pointers to unsigned long location, when I enable Banked Memory model.

 

Eg:

unsigned long * src, *dest;

  

Function_Copy (length)

{

src=(unsigned long *) 0x100000;

do

{

*dest = *src;

counter++;

} while( counter < length)

}

 

 

The SW works fine, in Large Memory Model. But once I switch to Banked Memory Model it doesn't.

Can anyone help me with this problem?

ラベル(1)
0 件の賞賛
返信
1 解決策
780件の閲覧回数
Lundin
Senior Contributor IV

Even though the S12 is a 16 bit MCU, the large model probably allows pointers larger than 16 bits, while the banked model doesn't. You have to use non-standard far pointers for addresses larger than 16 bits, or alternatively write inline assembler to handle the page registers.

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
781件の閲覧回数
Lundin
Senior Contributor IV

Even though the S12 is a 16 bit MCU, the large model probably allows pointers larger than 16 bits, while the banked model doesn't. You have to use non-standard far pointers for addresses larger than 16 bits, or alternatively write inline assembler to handle the page registers.

0 件の賞賛
返信