Ben, I talked not about offset between codes in different segments. I talked about possibility to make the code (staying in any single segment) to use offsets to PC pointer rather than table jumps. Then independently upon amount of segments I could use the adresses to navigate inside any single segment.
If CW buit-in assembler could understand pc-relative offset like lea smth(pc),a0 it would be a cure (while both this instruction and "smth" are in a single segment). But CW understands only lea smth,a0 and generates lea smth(a5),a0 what gives a wrong result for multisegment application. -- Konstantin "Ben Combee" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > At 12:39 PM 5/12/2004, you wrote: > >Everything (test1 and test2) works fine providing the code lays in the first > >code segment (code0). It fails for any other segment. > >Is there any way to use PC relative offset like > > lea.l table(PC),a0 (CW does not accept this syntax) > >or any other way to find correct value of table address (for multisegment > >application)? > > No. The key thing about segments is that there is no fixed relative > position between code in one segment and code in another segment. The only > way to get the address of something in another segment is to call a > function in that segment and have it return the address. Calls go through > the jump table and are resolved that way, but taking the address ends up > just returning the address of the jump table entry. > > -- Ben Combee, DTS technical lead, PalmSource, Inc. > Read "Combee on Palm OS" at http://palmos.combee.net/ > > > -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/