Path: utzoo!utgpu!water!watmath!clyde!ima!johnl Newsgroups: comp.compilers Subject: Re: Simplistic Assemblers? Summary: Unix assembler found unusable on real project Message-ID: <842@ima.ISC.COM> Date: 5 Jan 88 18:49:23 GMT References: <789@ima.ISC.COM> Sender: johnl@ima.ISC.COM Reply-To: watmath!attila!arlie (Arlie Stephens) Organization: Rohde&Schwarz Inc. Ottawa Canada Lines: 73 Approved: compilers@ima.UUCP In article <789@ima.ISC.COM> writes: >I would like to take a moment to dispute the >claims made here about simplistic assemblers being better for the human >assembler language programmer than complex assemblers. > <....lots of detail omitted....> > I agree with this poster, and disagree with all the people who've responded with things like: What you really need is a good macro processor SEPERATE from the assembler. For example, 'M4' is wonderful, and does everything an assembler programmer can possibly want. This is absurd. I've had the misfortune of porting 68010 assembler programs from a Motorola development system (with a 'real' assembler) to the Sun Unix environment (with Sun's Unix 'assembler' and M4). (The reason for this was budget; management wanted all development on the same system, and couldn't at first see why we should pay for a real assembler when we had one that came with Unix. The TARGET system remained the same.) M4 is NOT a full function macro processor. My biggest problem was that it doesn't know how to translate a character into its ascii value. We had a convention of storing strings as a sequence of characters with the high bit set on the last character. Strings were defined by a macro. How do you write that macro in M4 ? (Yes, there IS a kludge around...not a nice one.) This was not the only missing function ! M4 is not integrated with the assembler. How do I force a string (in the data segment or bss, not the text segment) to start on a word or long word boundary, when the assembler has no alignment directive available (except in the text segment) ? And then there's the problem of an assembler that's designed to assemble only the output of a C compiler, not ordinary human generated assembler. It is NOT fun to have the assembler fail to detect your typos, and generate semi-random code. I could cope with an assembler which lacks explanatory error messages, if it would at least catch all my errors ! I could not cope with the Sun assembler, which I understand is a typical Unix assembler, possibly better than some of the others. Management eventually accepted my recommendation that they buy a real assembler for the Sun...it cost much less than the time I was wasting wrestling with Sun's assembler. In all fairness: this was a purchased program, written in an environment where macro facilities were taken for granted. If I'd been writing it from scratch ON THE SUN I would have used C style strings, in spite of the extra memory, and I wouldn't have made data structures dependent on word alignment. Similarly, I would have designed around all the other problems. But then, poor tools have always placed arbitrary restrictions on program design ! I don't think having M4 seperate from the assembler was the real cause of any of my problems. It exacerbated the weaknesses of both tools by making it impossible for them to support each other. (Assembler programmers frequently write macros to replace missing assembler directives like 'place this point at a page boundary'; include a good selection of assembler directives and integration won't be needed.) Arlie Stephens Don't try to reply; this account dies today. [Unless people have other actual interesting experience to report, we can probably consider this topic finished. -John] -- Send compilers articles to ima!compilers or, in a pinch, to Levine@YALE.EDU Plausible paths are { ihnp4 | decvax | cbosgd | harvard | yale | bbn}!ima Please send responses to the originator of the message -- I cannot forward mail accidentally sent back to compilers. Meta-mail to ima!compilers-request