"Ioi Lam" <[EMAIL PROTECTED]> wrote in message news:36047@palm-dev-forum...
>
> Hi,
>
> I am looking at the "disassemble" view of a file, which makes a function
> call foo(param). CW gives me the same output regardless of which segment
> the foo() function is at. I though if foo() lives in a different segment
> than the caller, wouldn't the instructions be different?
>
>                 foo(param);
>                 TraceMethodExit(thisMethod);
>     move.l    a2,-(a7)
>     pea       *+16           ; 0x00000b4c
>     pea       *+6            ; 0x00000b46
>     addi.l    invokeNativeFunction,(a7)
>     rts
>
> Is there a way to look at the assembler code after the final link stage?

Not really... the CW disassembler only works on the object files.

However, after a link, the code should be the same.  For a intersegment
jump, you'll find the linker has changed the jsr instruction from using a PC
offset to doing an indirect jump through A5-offset global.  Its easy to see
that in the CW debugger by tracing through a intrasegment call.  The linker
collects the set of functions called across segment, allocates global space
for the indirect pointers, and sets up the relocation tables so the runtime
code that locks the non-0 segments in place fixes up the global pointers to
point to the appropriate location.

--
Ben Combee
Veriprise Wireless <http://www.veriprise.com>



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

Reply via email to