Re: Best tools for writing an assembler?

Hans-Peter Diettrich <DrDiettrich1@aol.com>
Tue, 25 Feb 2014 04:23:40 +0100

          From comp.compilers

Related articles
[15 earlier articles]
Re: Best tools for writing an assembler? lkrupp@pssw.com (Louis Krupp) (2014-02-24)
Re: Best tools for writing an assembler? ivan@ootbcomp.com (Ivan Godard) (2014-02-24)
Re: Best tools for writing an assembler? ivan@ootbcomp.com (Ivan Godard) (2014-02-24)
Re: Best tools for writing an assembler? james.harris.1@gmail.com (James Harris) (2014-02-24)
Re: Best tools for writing an assembler? hu47121@usenet.kitty.sub.org (2014-02-25)
Re: Best tools for writing an assembler? DrDiettrich1@aol.com (Hans-Peter Diettrich) (2014-02-25)
Re: Best tools for writing an assembler? DrDiettrich1@aol.com (Hans-Peter Diettrich) (2014-02-25)
Re: Best tools for writing an assembler? rpw3@rpw3.org (2014-02-25)
Re: Best tools for writing an assembler? walter@bytecraft.com (Walter Banks) (2014-02-27)
Re: Best tools for writing an assembler? noitalmost@cox.net (noitalmost) (2014-02-27)
Re: Best tools for writing an assembler? gneuner2@comcast.net (George Neuner) (2014-03-01)
Re: Best tools for writing an assembler? federation2005@netzero.com (2014-03-26)
Re: Best tools for writing an assembler? federation2005@netzero.com (2014-04-13)
| List of all articles for this month |
From: Hans-Peter Diettrich <DrDiettrich1@aol.com>
Newsgroups: comp.compilers
Date: Tue, 25 Feb 2014 04:23:40 +0100
Organization: Compilers Central
References: 14-02-018 14-02-025 14-02-027 14-02-033
Keywords: assembler, optimize
Posted-Date: 27 Feb 2014 19:06:32 EST

glen herrmannsfeldt schrieb:


> There are some interesting cases where the instruction choice (and
> length) depends on the size of an address, which (in the case of a
> forward reference) depends on the instruction length. If you can
> avoid that, it is pretty easy.
>
> -- glen
> [Variable length instructions aren't that hard. You start by assuming
> everything will be the long form, then iterate over the code a few
> times shrinking what you can. That isn't always perfectly optimal
> (which is known to be NP complete), but it's pretty close. -John]


Hmm, I'd start with the *shortest* encoding, and extend whatever doesn't
fit afterwards. This avoids "deadlocks", resulting from kind of circular
references. Indeed harder is reordering parts of the code, in order to
reduce the number of long references - kind of "travelling salesman"
problem?


DoDi


Post a followup to this message

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