Path: utzoo!mnetor!uunet!husc6!mit-eddie!uw-beaver!tikal!sigma!uw-nsr!john From: john@uw-nsr.UUCP (John Sambrook) Newsgroups: comp.lang.c Subject: Re: Portable "asm" (Was: The D Programming Language) Message-ID: <1264@uw-nsr.UUCP> Date: 15 Mar 88 08:10:29 GMT References: <4257@june.cs.washington.edu> <5080022@hpfcdc.HP.COM> <1092@PT.CS.CMU.EDU> Reply-To: john@uw-nsr.UUCP (John Sambrook 548-4386) Organization: UW-Bioengineering, Seattle, WA Lines: 36 Summary: Another reason to eschew the use of #asm In article <1092@PT.CS.CMU.EDU> edw@IUS1.CS.CMU.EDU (Eddie Wyatt) writes: >> [someone else] >> Since the interface between C and in-line asm seems to be so >> problematic (not to mention non-portable), why not write >> those routines that should be written in assembly in assembly? > >To which the obvious reply is speed - functions invocation can be >RELATIVELY expensive. The time taken to invoke a subroutine may >out way any gains that the asm statement made. Disclaimer - I don't use >asm - don't plan on it either. If performance is critical write the whole subroutine in assembler, not just the innermost loop. Of course, those people who have "subroutines" that span 10+ pages will whine about it being "too much work." Further, consider that on many systems the conventions for inter- language calling are spelled out in the system documentation and users are advised to conform to the standard. Vendors agree not to change the standard indiscriminately. However, the code generated by a given compiler is under no such obligation and likely to change whenever a new revision of the C compiler is installed. Maybe other people have different priorities than I do. I'd consider it a tremendous waste of time to run around fixing programs that quit working just because I installed a new version of the C compiler. "If it looks like a hack, feels like a hack, smells like a hack ... it's a hack." Is anyone else wondering if Herman Rubin and Doug Pardee are related? :-) -- John Sambrook Internet: john@nsr.bioeng.washington.edu University of Washington RC-05 UUCP: uw-nsr!john Seattle, Washington 98195 Dial: (206) 548-4386