Re: Best tools for writing an assembler?

Walter Banks <walter@bytecraft.com>
Thu, 27 Feb 2014 14:14:49 -0500

          From comp.compilers

Related articles
[17 earlier articles]
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: Walter Banks <walter@bytecraft.com>
Newsgroups: comp.compilers
Date: Thu, 27 Feb 2014 14:14:49 -0500
Organization: Aioe.org NNTP Server
References: 14-02-018 14-02-025 14-02-027 14-02-033 14-02-038
Keywords: assembler, tools, comment
Posted-Date: 27 Feb 2014 19:09:19 EST

Hannah wrote:


> Hi!
>
> glen herrmannsfeldt <gah@ugcs.caltech.edu> wrote:
>
> Actually, our moderator wrote:
>
> >[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]
>
> Can't one also go the other way round: Start in the short(est) form and
> lengthen as long as needed?
>
> Hannah.
> [Shrinking long versions has the advantage that the code is always valid,
> even if you miss a few. -John]


One processor that we did a few years ago had three branch types
4 bit signed offset, jump within 256 byte page and unlimited jump.
(National COP8) Coded as 1,2,3 byte instructions. The page jump
caused all kinds of havoc as the code moved around as the branches
were being optimized.


It was the first processor I saw that that starting long and shrinking
the code wouldn't work cleanly.


Walter Banks
[The PDP-8 had short references to the current page or page 0,
and long indirect references. Back in that era, we juggled code
into pages by hand. -John]


Post a followup to this message

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