On 2010-06-17, Przemek Klosowski <[email protected]> wrote:
> On Thu, Jun 17, 2010 at 3:01 PM, Grant Edwards
><[email protected]> wrote:
>> On 2010-06-17, JMGross <[email protected]> wrote:
>
>>> interesting. Still two wasted bytes (I don't think the linker will
>>> move the following code and adjust any other jumps if necessary),
>>
>> Yes, if the linker supports changing address modes, then it does
>> move the following code.
>
> FWIW, this is a well-known and tricky problem, because you can get
> circular dependencies: short addressing at location A can only reach
> site B if site B also uses short addressing, and vice versa. There's a
> standard algorithm that deals with, for quite some time---I remember
> first reading about it in the 80s.
Yep, IIRC, it's an example of a large class of non-linear problems
that includes modelling of physical systems where changes in the state
of a node/cell affects the states of other nodes/cells.
You try to find the the best overall approximation to a solution using
an iterative approach that makes multiple passes through the data
until no more improvements can be made.
That sort of an agorithm is called a relaxation algorithm.
If I'm remembering things correctly from many years ago, one main
groups of problems in that class is calculating the final state of an
irregular physical structure when the applied stresses are changed.
The structure will "relax" into a new equilibrium state that minimizes
overall strain. Or stress. Or something like that. But don't quote
me, I'm an EE.
Or maybe I'm incorrectly mixing together unrelated things simply
because they all use the world "relaxation" or "relax".
--
Grant Edwards grant.b.edwards Yow! I was born in a
at Hostess Cupcake factory
gmail.com before the sexual
revolution!