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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
923 Views
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?

Labels (1)
0 Kudos
1 Solution
340 Views
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.

View solution in original post

0 Kudos
1 Reply
341 Views
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 Kudos