Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ut-sally!husc6!cmcl2!brl-adm!adm!rbj@icst-cmr.arpa From: rbj@icst-cmr.arpa (Root Boy Jim) Newsgroups: comp.unix.questions Subject: Teaching Assembler on VAX (BSD 4.3) Message-ID: <7449@brl-adm.ARPA> Date: Tue, 19-May-87 10:51:17 EDT Article-I.D.: brl-adm.7449 Posted: Tue May 19 10:51:17 1987 Date-Received: Wed, 20-May-87 05:14:20 EDT Sender: news@brl-adm.ARPA Lines: 70 >I did look at m4, but it is really geared to C It is? Why, then, is someone I know experimenting with using it as a front end to the Sun assembler? (Well, then again, he has some some other pretty dumb things :-) .) I don't have the original article, but maybe he meant "is it" rather then "it is". I don't see m4 as being particularly tailored for or against C or assembly or anything else for that matter. Fortran maybe? >and did not really address the problem of sophomore students learning >a very user-unfriendly assembler. Okay, here is the *real* question: What makes an assembler friendly or unfriendly? I'm surprised you had to ask, Chris, or was that a rhetorical question? I have used: EDTASM (Z80); two homegrown assemblers (Z80); Microsoft's M80 (Z80); a rather weird assembler written in FORTRAN (IBM 370); 4BSD `as' (Vax); Sun `as' (680x0); GENIX `as' (NS320xx); Microsoft's MASM (80x86). Only M80 and MASM had extensive built-in macro facilities, but I never really missed these with the others. I think this is a major requirement for serious asm hacking. As a litmus test, I would say the ability to write a set of macros which implemented if-then-else, while, and the like (in short, a mini compiler), is a pretty good assembler. Two such beasts are the VMS assembler, basically a descendent of MACRO-11 (um, maybe it's *still* called that), and @ASM or @MASM over on the UNI{VAC,SYS} 1108 (or whatever model). Walk on over to ZBEN's office sometime and ask to see a copy of STRUC$. In the case of the Vax and Sun assemblers, I use the C preprocessor, since the assemblers will accept semicolon-separated statements: movl $0,r7; 1: addl2 r9,r7; ashl $1,r9,r9; bbc $12,r9,1b (/lib/cpp eats newlines in macros, hence something like this is required. m4 does not eat newlines.) In fact, I would rather use cpp for assembly as well. But perhaps m4 can generate multi-line text? So what is /bin/as missing, or what does it do wrong, that makes it user-unfriendly? Of course, the UNIX `as' is not supposed to be friendly, because you're not encouraged to use it. I think any UNIX `as' is probably not very good for teaching purposes. It's main purpose and design is as a back end for compilers. On the other hand, perhaps it is very well suited for teaching, because there are no frills to be distracted by. In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690) Domain: chris@mimsy.umd.edu Path: seismo!mimsy!chris (Root Boy) Jim "Just Say Yes" Cottrell Yow! I want to mail a bronzed artichoke to Nicaragua!