[Coco] Direct page register question
James Jones
jejones3141 at gmail.com
Tue Oct 30 22:38:20 EDT 2018
Turns out there's an efficient algorithm that will let an assembler
correctly choose either short or long branches so the programmer doesn't
have to worry about it--*if* the destinations are either labels or
assembly-time expressions constrained to a particular form. (Without that
constraint, picking the right flavor of branch is NP-complete, effectively
as nasty as it gets.)
The solution was known in 1978; it was published in the April 1978
*Communications
of the ACM*. ("Assembling Code for Machines with Span-Dependent
Instructions", Thomas G. Szymanski, CACM 21(4):300-308). I used to have
that issue, but managed to lose it in a move. I don't remember the
algorithm or the constraint, though if memory serves, the constraint seemed
reasonable. Not sure whether it would push an assembler on the 6809 over
the 64K limit, but for a cross assembler, it would be no problem.
More information about the Coco
mailing list