[A89] Re: sorry!
[Prev][Next][Index][Thread]
[A89] Re: sorry!
> My guess (total guess, keep in mind) is that these are offsets into
> the code. The doublewords at these offsets have the address of the
> beginning of the code added to them.
Good guess. :-) This is exactly how kernel programs do it, but it
requires that the address of the beginning of the code is subtracted
again after termination of the program. It seems TI was too lazy to do
that. :-( So the relocation table of the AMS (at the end of the program
or Exec string) contains pairs of offsets into the code; one for the
place where relocation takes place, the other for the relocation target.
> This allows the code to use
> absolute memory references despite not knowing where it will be placed
> in memory.
Exactly.
> Since the calc knows the end of the list, however, I have
> no clue why it should be null-terminated.
The AMS has to read the list backwards. So what you call the "end" is
actually the beginning of the list from the AMS's point of view. The two
terminating zero bytes are at the place you would call the "beginning".
--
Sebastian Reichelt
References: