|[Q] Assembling with variable length instructions firstname.lastname@example.org (Jonathan Belson) (2000-02-15)|
|Re: [Q] Assembling with variable length instructions email@example.com (Robert Harley) (2000-02-16)|
|Re: [Q] Assembling with variable length instructions firstname.lastname@example.org (James Jones) (2000-02-16)|
|Re: [Q] Assembling with variable length instructions email@example.com (Joachim Durchholz) (2000-02-16)|
|Re: [Q] Assembling with variable length instructions firstname.lastname@example.org (Peter Morse) (2000-02-19)|
|From:||"Peter Morse" <email@example.com>|
|Date:||19 Feb 2000 00:26:37 -0500|
|Organization:||Verinet Communications, Inc. (970/224-5551)|
A good approach I have seen to this problem is to record two addresses for
each symbol or instruction during the first pass. One address assumes all
spans are short while the second address assume all spans are long. Then
between the passes scan the address pairs for one of three situations.
1. Both spans are short - use a short span address
2. Both spans are long - use a long span address
3. One span is short and one is long - here is where things get
interesting - there have been various schemes published for dealing with
this case including some of the methods already mentioned. Or, one could get
lazy and assume a long span.
It makes sense to handle all the case 1 and 2 situations first and adjust
the address pairs accordingly. Some of the case 3 situations may resolve
themselves into case 1 or 2.
Return to the
Search the comp.compilers archives again.