At 11:53 PM 7/4/2003, Konstantin Klyatskin wrote:
small problem here: I used 8 just as example showing that this instruction
can be compiled in CW. Actually it fails on calculating offset of the
function "data" entry  relative to statement location . This offset could be
calculated manually using  the map file and coded back by dw. statements.
But surely that's wat I'd like to avoid....

CW's inline assembler doesn't know about relative addresses within the file, as each item has its own section, and outside of a single function, the compiler doesn't know how far anything is from anything else.


If you look at the code we generate in the shared library wizard for calling functions through a dispatch table, you'll see that the inline assembly syntax is a little limited.

I really don't know the syntax to do what you want. It may not be possible. I'd start by redefining your data function to just be

#pragma pcrelconstdata on
const char data[] = { 1, 2, 3, 4 };
#pragma pcrelconstdata reset

then just refer directly to data. The pc-relative instruction should be generated, as the compiler knows that data's a .text-based variable due to the pragma.

--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com



-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Reply via email to