Path: utzoo!utgpu!water!watmath!clyde!ima!johnl From: peter@sugar.UUCP (Peter da Silva) Newsgroups: comp.compilers Subject: Re: Simplistic Assemblers? Message-ID: <1415@sugar.UUCP> Date: 24 Jan 88 08:12:51 GMT References: <789@ima.ISC.COM> <842@ima.ISC.COM> Sender: johnl@ima.ISC.COM Reply-To: peter@sugar.UUCP (Peter da Silva) Organization: Sugar Land UNIX - Houston, TX Lines: 45 Approved: compilers@ima.UUCP In article <842@ima.ISC.COM>, writes: > 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.) You shouldn't need to. I ported a FORTH from MACRO-11 to M4 plus AS, and had to do this very thing. I don't recall how I did it (this was something like 3 years ago), but I'm pretty sure it did something like: head(dup... generated: byte 3|200, 'd', 'u', 'p'|200 Doesn't look like a kludge to me... > 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) ? Your assembler should have that function. The pdp-11 version of as did. > 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. Could be a problem, yes. It didn't seem too bad for me. All my interface code for the file I/O was in as and it came together pretty well. It did catch typos in mnemonics pretty well... > I could not cope with the Sun assembler, which I understand is a typical > Unix assembler, possibly better than some of the others. It sounds like the Sun 68000 assembler is NOT better than the typical "as". As should provide all the functions you mentioned. Perhaps the pdp-11 as was more heavily used by the programmers who developed it. I believe that quite a bit of 5th edition was written in it. [true, including the notorious `fc' Fortran. -John] -- Peter da Silva `-_-' ...!hoptoad!academ!uhnix1!sugar!peter -- 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