Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: $Revision: 1.6.2.16 $; site haddock.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!bbnccv!haddock!lee From: lee@haddock.UUCP Newsgroups: net.lang.c Subject: Re: Re: Re: about void voids (Re: efopen Message-ID: <86900003@haddock.UUCP> Date: Sat, 23-Nov-85 18:08:00 EST Article-I.D.: haddock.86900003 Posted: Sat Nov 23 18:08:00 1985 Date-Received: Mon, 25-Nov-85 07:26:24 EST References: <382@celerity.UUCP> Lines: 24 Nf-ID: #R:celerity:-38200:haddock:86900003:000:968 Nf-From: haddock!lee Nov 23 18:08:00 1985 I think that "asm" should only be used in functions that meet both of the following conditions. 1) The function is inherently machine-dependent, so that it would have to be re-written to port it to a substantially different machine. 2) The alternative to using "asm" is to write it entirely in assembly language. I sometimes find an alternative to condition 1) along the following lines: 1a) the function is performance sensitive and can be significantly improved in performance on a particular architecture by insertion of small amounts of inline assembly code. For example, the operation performed by the IBM 370 "tr" instruction or the VAX "movtc" instruction can replace a loop in critical sections of otherwise ordinary C code. In these cases, of course, the asm() directive containing FOO assembly code should be embraced in "#if defined(foo)" and the equivalent C code compiled for architectures for which the asm() directives are not provided.