Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!lll-lcc!ptsfa!hoptoad!academ!uhnix1!sugar!peter From: peter@sugar.UUCP (Peter da Silva) Newsgroups: comp.misc Subject: Re: Assembly Language Message-ID: <525@sugar.UUCP> Date: Thu, 20-Aug-87 19:07:36 EDT Article-I.D.: sugar.525 Posted: Thu Aug 20 19:07:36 1987 Date-Received: Sun, 23-Aug-87 11:22:58 EDT References: <892@edge.UUCP> <7359@think.UUCP> <904@edge.UUCP> Organization: Sugar Land UNIX - Houston, TX Lines: 66 Summary: Talk about cherry picking :-> In article <904@edge.UUCP>, doug@edge.UUCP (Doug Pardee) writes: > True. But this is cherry-picking for the example which best illustrates > your point. Counter-example: this line of 80x86 assembler expands into > several lines of just about any HLL: > > REP MOVSB > > When you count HLL lines, don't forget all of those lines that don't even > generate any code at all. How about the ever-popular C line, "}"? And when you count assembly lines, add in all the ones needed to set up for that instruction. Particularly if you have to load adresses of subroutine arguments and add offsets to array locations... The big loss in assembly is all that glue you have to add. How about the plain old 'C' fragment: printf("Hello world.\n"); I don't know 80x86 assembly very well, so how about PDP-11, a much tighter an easier to deal with instruction set than 80x86: HELLO: .ASCII /Hello World./ .BYTE 12,0 .EVEN ... MOV #HELLO,-(SP) JSR PC,_PRINTF TST (SP)+ > That is petty stuff, though. The real point is that some applications > are "naturals" for the HLL, in which case I say DO use the HLL. But for > many others you have to go out of your way to accomplish the task, and > that usually means extra HLL code. The only application I've found that was a natural for Assembly was imnplementing FORTH. The other place you need assembly (as opposed to preferring it for speed or space) is dealing with an assembly-style interface to an operating system. > >Assembler also suffers ... the lack of direct support for record structures > using. These record structures (often called DSECTS in assembly) are > available with IBM 360/370 assemblers, and with the Microsoft assembler for > the IBM PC. No doubt with other assemblers too. A DSECT is more like a FORTRAN common block than a structure. Neither quite fills the bill when only a structure will do. > Unfortunately, in the Unix universe it is assumed that nobody programs in > assembler, so Unix assemblers tend to be unusable trash. A vicious cycle. They do tend to be reliable and unsurprising, something that can't be said for PC-DOS assemblers. And a macro package (like M4) makes a lot of difference. I much preferred M4 and AS to Macro-11 when I ported John James' FIG-FORTH to the PDP-11. > I'm trying to make two distinct points here: 1) one of the biggest reasons > that HLLs are used for applications that should have been done in assembly > is programmer laziness. The only example of this I can think of is that 'C' implementation of FORTH, which was done more as an excersize than anything else. -- -- Peter da Silva `-_-' ...!seismo!soma!uhnix1!sugar!peter (I said, NO PHOTOS!)