|1-pass Assembler Design firstname.lastname@example.org (Marv Luse) (1998-08-13)|
|Re: 1-pass Assembler Design email@example.com (Jerry Leichter) (1998-08-16)|
|Re: 1-pass Assembler Design firstname.lastname@example.org (Glenn Kasten) (1998-08-16)|
|Re: 1-pass Assembler Design email@example.com (Norman Ramsey) (1998-08-16)|
|Re: 1-pass Assembler Design firstname.lastname@example.org (1998-08-16)|
|Re: 1-pass Assembler Design email@example.com (1998-08-17)|
|Re: 1-pass Assembler Design firstname.lastname@example.org (Michael Meissner) (1998-08-17)|
|Re: 1-pass Assembler Design email@example.com (1998-08-19)|
|Re: 1-pass Assembler Design firstname.lastname@example.org (Jack W. Crenshaw) (1998-08-19)|
|Re: 1-pass Assembler Design email@example.com (Norman Ramsey) (1998-08-20)|
|Date:||16 Aug 1998 22:46:54 -0400|
In comp.compilers "Marv Luse" <firstname.lastname@example.org> writes:
>I have been pondering the design of a 1-pass assembler and have been
>considering schemes for dealing with forward references (i.e., jump to
>label not yet found in source code). Does anyone have any suggestions
>for a practical scheme for doing this? I have devised several
>approaches, but have limited time for investigation, so if someone
>could suggest an approach that would be great.
The GNU assembler is a 1-pass assembler. It uses a fairly
straightforward scheme that I believe is due to Richard Stallman.
An assembler must obviously be prepared to write out relocation
information. You treat a jump to an undefined symbol as a relocation.
At the end of the assembly you go back and fill in any relocations
which turn out to be for defined symbols.
Some object file formats can only represent a limited number of
relocations, so you may have to be able to represent more relocations
internally than you can actually write out to the object file.
This approach does assume that you can buffer up your output file in
memory before writing it to the output file.
Return to the
Search the comp.compilers archives again.