Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!seismo!mimsy!eneevax!umd5!brl-adm!adm!rbj@icst-cmr.arpa From: rbj@icst-cmr.arpa Newsgroups: comp.unix.questions Subject: Teaching Assembler on VAX (BSD 4.3) Message-ID: <7573@brl-adm.ARPA> Date: Thu, 28-May-87 15:40:22 EDT Article-I.D.: brl-adm.7573 Posted: Thu May 28 15:40:22 1987 Date-Received: Sat, 30-May-87 11:25:37 EDT Sender: news@brl-adm.ARPA Lines: 97 This is an issue that touches close to the hearts of many, ergo the surfeit of heat and deficit of light. When do we move the discussion of assembly language from the Computer Science undergraduate program to the "history of technology" curriculum? As an aside, I'd surely like to know if the Japanese are teaching assembly language. Yes, this is certainly getting out of hand. I would imagine the Japanese *do* teach assembly because they are very thorough and rigorous. However, the one main reason to keep doing so is that assembly language is *fundamental to what a computer really is*. One thing to keep in mind is that the majority of readers of this net are using Unix systems, and have (rightly or wrongly) bought into the canard that assembly language is dead. Thus they are likely to advance the argument that teaching assembly language is a stupid thing to do, rather than try to solve the problem as presented. I would say that there are still arenas where asm is king, but we have entered the age where HLL's are both available and sufficient to get the job done. This was not always true, partially because we were often programming around the machines' limitations, such as a 16-bit address space. Yet, just because assembly is becoming rarer is no grounds for ignoring it altogether. CS stands for Computer *Science*, not Computer *Applications*. The purpose of a CS degree or education is to familiarize the student with an appreciation/overview of all the major fields that have to do with computers and some of the mathematical theory behind it. That is what makes us different from say, Cobol programmers. I may be one of the worst assembler-bigots around, but UMD5 has been three different machines in the past 5 years (PDP-11, uVax, 750) and I haven't writen a line of assembly code. I've had a Mac Plus for more than a year, and haven't written a line of assembly code. It's quite impressive that Megaroids (an "asteroids" clone for the Mac) is entirely written in MegaMax C and suffers no lossage due to time constraints (this kind of real-time environment is where any such lossage should show). Bigot? I would say Freak! But, yes, the times, they are a changin'. Certain machines, such as the 8080 or Z80, don't lend themselves well to any HLL, and are barely tolerable in assembly. This is becoming less true. Yes, knowing some assembly languages can really help when dealing with bogus compilers, and I have found bad code bugs in both the IBM Pascal and Fortran H compilers by inspecting the machine language output. True, but mostly all that stuff works. And so should any macros. I used to write huge gory assembly macros, but stopped because none of my co-workers could understand them. I still do macros, but simple ones that only solve the task at hand, rather than huge gory packages that try to be everything to everybody and end up being nothing to nobody... Eventually we all mellow out. However, I see no distinction between macros and functions/subroutines conceptually. Wanting to see the generated code is not an argument against macros, as a good assembler will do given an optional flag. As Ben points out, these macros should be fool-proof, so as to be taken at face value. Likewise, fear of typographical errors is not a valid concern. With that kind of attitude, how would you ever type the expansion correctly. Yes, confusion between pointers to objects and their actual contents is a concern, but macros, as well as higher level languages, are more likely to be able to check that they are invoked reasonably than the underlying instructions which will often work with any mode operands. In short, macros are there, so use them, but use them wisely. Is it possible that the "ultimate dead language" comment on the AS man page might be a comment on the PDP-11 instruction set itself, rather than generically condemning all assembly languages? Since some of the wartier "features" of C (undefined fill on right shift, promotion of float to double on function call, etc) can be traced directly to the uglyness of the PDP-11 instruction set, one can certainly sympathize... I beg to differ. The PDP-11 has a BEAUTIFUL instruction set. How could you possibly think otherwise? The PDP-11, more than any other machine, has defined the essence of todays instruction sets. Sure it had some warts, but everything does. The ambiguity of C is more related to the differences *between* machines than to any one particular droid. umd5.UUCP <= {seismo!mimsy,ihnp4!rlgvax}!cvl!umd5!zben zben @ umd2.UMD.EDU Kingdom of Merryland UniSys 1100/92 umd2.BITNET "via HASP with RSCS" (Root Boy) Jim Cottrell National Bureau of Standards Flamer's Hotline: (301) 975-5688 While you're chewing, think of STEVEN SPIELBERG'S bank account.. This will have the same effect as two ``STARCH BLOCKERS''!