Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!rex!ukma!hsdndev!bu.edu!polygen!jerry From: jerry@polygen.uucp (Jerry Shekhel) Newsgroups: comp.sys.apple2 Subject: Re: HLLs vs. Assembly Message-ID: <1035@stewart.UUCP> Date: 8 Apr 91 23:05:36 GMT References: <13156@ucrmath.ucr.edu> <1991Mar30.080418.16299@ee.ualberta.ca> <1029@stewart.UUCP> <13345@ucrmath.ucr.edu> Reply-To: jerry@stewart.UUCP (Jerry Shekhel) Organization: Polygen Corporation, Waltham, MA Lines: 38 In article <13345@ucrmath.ucr.edu> rhyde@ucrmath.ucr.edu (randy hyde) writes: > >All languages (included different assembly languages) have a "programming >paradigm". The differences between some languages is subtle (e.g., there >are small, subtle, differences between languages like "C" and Pascal, there >are considerable differences between languages like "C", Snobol4, ICON, LISP, >Prolog, and SETL). Some languages are especially suited for certain apps. > I see your point; I guess I was just thinking of C. I still don't see how anything could be easier to code in assembly language than in C. Maybe that's why they say that C is not a real high-level language. > >Any application which requires bit pushing, assembly language wins hands >down (a good example is a SCSI device driver I have been converting from C >to 32532 assembly language). The program will generally shorter by a factor >of two or more and about 10-100 times faster. Furthermore, in the hands of >competent assembly and C programmers, the assembly language program will >be easier to read and understand. This is not an absolute assessment, but >it has been true most of the time, in my experience. > I must disagree with this, again, keeping C in mind. Any decent compiler will optimize register usage, and C expressions like "a <<= 5" or "a &= ~0x1234" will normally compile down to a single instruction. So I really don't see your "bit-pushing" argument here, and certainly not the performance increase factors you quote. Of course, you may have been thinking of FORTRAN or LISP... -- +-------------------+----------------------+---------------------------------+ | JERRY J. SHEKHEL | POLYGEN CORPORATION | When I was young, I had to walk | | Drummers do it... | Waltham, MA USA | to school and back every day -- | | ... In rhythm! | (617) 890-2175 | 20 miles, uphill both ways. | +-------------------+----------------------+---------------------------------+ | ...! [ princeton mit-eddie bu sunne ] !polygen!jerry | | jerry@polygen.com | +----------------------------------------------------------------------------+