Re: [Q] Assembling with variable length instructions

"Peter Morse" <peterm@gwe.net>
19 Feb 2000 00:26:37 -0500

          From comp.compilers

Related articles
[Q] Assembling with variable length instructions jonbelson@hotmail.com (Jonathan Belson) (2000-02-15)
Re: [Q] Assembling with variable length instructions harley@corton.inria.fr (Robert Harley) (2000-02-16)
Re: [Q] Assembling with variable length instructions jejones@microware.com (James Jones) (2000-02-16)
Re: [Q] Assembling with variable length instructions joachim.durchholz@halstenbach.com.or.de (Joachim Durchholz) (2000-02-16)
Re: [Q] Assembling with variable length instructions peterm@gwe.net (Peter Morse) (2000-02-19)
| List of all articles for this month |
From: "Peter Morse" <peterm@gwe.net>
Newsgroups: comp.compilers
Date: 19 Feb 2000 00:26:37 -0500
Organization: Verinet Communications, Inc. (970/224-5551)
References: 00-02-070
Keywords: assembler

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.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.