Re: [hatari-devel] Re: BM407 + symbols

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On tiistai 09 huhtikuu 2013, Douglas Little wrote:
> > It claims that most "calls" to "end_addwall" were subroutine call
> > returns (=r) to it from address 0x155.  Which is true as previous
> > instruction at 0x378 was subroutine call, and return from that
> > call returns to 0x379:
> > ----------
> > p:0155  00000c         (04 cyc)  rts
> > ...
> > p:0378  0f7130         (04 cyc)  jsgt p:$0130
> > end_addwall:
> > p:0379  699b00         (02 cyc)  move y:$001b,r1
> > ----------
>
> I don't think that is correct.
>
> 'end_addwall' is not a subroutine for anything.
> It is part of a flat chain, where pieces of the chain may
> change. In fact there are no subroutine calls involved in that chain.

Doh, now I see it.

These DSP subroutine calls are conditional, and with current Hatari
DSP profiler code (which is modeled after CPU profiler code), if such
call isn't done, profiler will still think that it was a subroutine call,
if some subroutine starts on the next instruction.

Any idea what would be the best way to check, on next instruction
from conditional subroutine call instruction, whether subroutine
call was actually done or not?

For all of these instruction families:
JSCC : jump to subroutine under a condition
JSCLR : Jump to Subroutine if Bit Clear
JSSET : Jump to Subroutine if Bit Set
?


For example, how safe assumption it would be that if the "called" subroutine
is on next instruction, it actually wasn't a call?

For subroutine call instructions that take an absolute address instead of
destination being specified indirectly (e.g. in register), that would
probably be very safe as absolute subroutine call to next instruction
would be really dumb.  :-)

I would assume that even for indirect destinations that is pretty safe.
I'd guess it rare for code to call subroutine on next instruction before
going to it by normal PC increment.  It might still happen though, if one
needs to do tail call to the same function multiple times and wants to
save one branch & rts instruction...


	- Eero



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/