Re: [A85: Re: ] (Usgard relocation)


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

Re: [A85: Re: ] (Usgard relocation)




I discussed this with Kimmy once, and got a good explanation on how it works
(I also got the source for srcwiz so I know how it works). What happens is
something like this (I have worked witht his for a while but this is how I
remember it).

srcwiz goes thrue the src code and looks for any lable with a & in front.
When a & is found it is deleted and a label with a speciel name is added in
front of that instruction. Then TASM is started with a special option which
creates a file with a list of all the symbols (labels) and their value. By
looking at this file srcwiz knows which addresses in the .obj file it has to
adjust. Básed on this it creates the table at the end of the program. The
table entries specifies the offset from the current posistion to the next
relative address (1 byte), if the offset is too big an escape char is used
first followed by 2 bytes which is the correct offset. When usgard needs to
start a program it goes thrue the program by reading the offset and jumping
that number of bytes. Then PROGRAM_ADDR is added the word at that the
location and usgard continues.

Dines



References: