Date : Mon, 29 Mar 1993 15:54:39 +0200
From : stjohn@... (Chris StJohn)
Subject: Relocation of 6502 images
>I'm currently considering how to handle executables. Seeing as
>relocation is difficult, I'm considering dumping the running image
>to disc before loading the new image, and then retoring it
>afterwards. The problem with this is for compiled code which uses a
>stack in a distant part of memory from the main program.
Is relocation really that difficult? You'd only have to relocate to the
nearest page boundary, and you should be able to deduce the relocation
purely from the instruction context in programs written in a neat style.
eg. (my 6502 is a little rusty - forgive me...)
LDA (&2a00),Y
should be relocated whereas
STA &72
should not.
I think the benifits of relocation (stacking executables and, who knows,
maybe even lightweight threads(!)) outweigh the disadvantages.
If you're really against relocation, you could use SRAM to page programs
into memory.... At worst, copy the image into a memory cache rather than
writing to disk.......
Just my 10 centime's worth...
,--, Chris StJohn, LIX, Ecole Polytechnique, 91128
/ /_ __' _ Palaiseau, Cedex, FRANCE. (+33) 1.69.33.45.93
(____/ (_/ (_/_).
Don't mean they're not after you" -- Nirvana