[A83] Re: TI-OS resumes


[Prev][Next][Index][Thread]

[A83] Re: TI-OS resumes




> Van: Peter-Martijn Kuipers <hyper@hysoft-automation.com>
>
> > > Van: Peter-Martijn Kuipers <hyper@hysoft-automation.com>
> > > 
> > > Wait, wait, what are you referrring to?
> > 
> > Some mails ago somebody thought of a program like:
> > 
> > 	pop	hl
> > 	push	hl
> > 	jp	_disphl
> > 
> > to display where the TIOS calls your program... But it -indeed- it
> > should be "to display where the returns to the TIOS" (I don't know
> > what was exactly written down there, so don't pin me on this...) 
> 
> I checked it out, and the return address is indeed a different address
> than the address from which the prog ist started.
> However, if you follow the call right before the address you return to,
> you can find the calling address

Oh yes, normaly 3 bytes before the adress you 'return to' the actual call
is located.

And that might also be so on the Ti-83(+) when running a program from TIOS,
but in general you can not count on it that the caller did things like
this:

--------------------
	[..code..]
	call	_your_routine_
return_point:
	[..more code..]
--------------------

Since there could also be done this:

--------------------
	[..code..]
	call	blah
return_point:
	[..more code..]

blah:
	[..possibly some code here..]
	jp	_your_routine_
--------------------

or:

--------------------
	[..code..]
	ld	{16bit reg},return_point
	push	{16bit reg}
	jp	_your_routine_
--------------------

And there are probably some more possibilities (a 'calculated call' in HL
for example), but I hope *you* get the point.

	Henk Poley <><




Follow-Ups: