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,097 次查看
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 解答
514 次查看
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 回复
515 次查看
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 项奖励
回复