> I have the same problem as you discribed with short addressing and > peripheral from C. > > Have you managed to solve the problem ? > I have tried the suggestion from Robert but it does not help me. > Right now I have done a stupid work around with assemble code inside > C. With the movep statement. The only way I can do it is with inline assembly. I was told (by Lubomir, Motorola) that "...codewarrior doesn't make difference between x-mem and p-mem pointers ...". I guess that it doesn't make any difference between short and long addressing either. I assume that it always points to data memory using 16-bit addressing. I couldn't find anything on targeting about addressing. And there is no intrinsics for this either. **** For assembly language, I am trying the following: I duplicate my registers/memory definitions, with some prefix, like: #define asmPLLCR (CLKGEN_BASE+0x0) /* Control Register */ Then I define the following: #define WriteShort(A, B) asm( move #A , X:<<B ) Then access as: WriteShort(0x300,asmPLLCR); It is not working for me. I haven't tried much but maybe you can figure out if it will work or not. The great advantage is that WriteShort is not a function call. It will give you just one move instruction. I am still pretty lame with assembly, so I assume that the code I included is wrong. Maybe you should modify it like this, with two move operations: #define WriteShort(A, B) asm( move #A , Y0 ; move Y0, X:<B ) Hope this helps. Please let me know if you found a way of making this work. Mariano |