[gnu.gcc] Interrupt handlers, C, asm, portability, ...

lewie@EE.ECN.PURDUE.EDU (Jeff Lewis) (08/11/89)

	From info-gcc-request@prep.ai.mit.edu Thu Aug 10 20:14:07 1989
	Received: from ea.ecn.purdue.edu by ee.ecn.purdue.edu (5.61/1.18jrs)
		id AA08596; Thu, 10 Aug 89 20:14:03 -0500
	Received: from life.ai.mit.edu by ea.ecn.purdue.edu (5.61/1.18jrs)
		id AA12708; Thu, 10 Aug 89 20:13:57 -0500
	Received: by life.ai.mit.edu (4.1/AI-4.10) id AA04430; Thu, 10 Aug 89 15:46:02 EDT
	Return-Path: <info-gcc-request@prep.ai.mit.edu>
	Received: from tut.cis.ohio-state.edu by life.ai.mit.edu (4.1/AI-4.10) id AA04113; Thu, 10 Aug 89 15:28:38 EDT
	Received: by tut.cis.ohio-state.edu (5.61/4.890725)
		id AA13279; Thu, 10 Aug 89 14:37:45 -0400
	Received: from USENET by tut.cis.ohio-state.edu with netnews
		for info-gcc@prep.ai.mit.edu (info-gcc@prep.ai.mit.edu)
		(contact usenet@tut.cis.ohio-state.edu if you have questions)
	Date: 10 Aug 89 18:24:23 GMT
	From: oliveb!Ozona!chase@bbn.com  (David Chase)
	Organization: Olivetti Research Center, Menlo Park, CA
	Subject: Re: interrupt handlers
	Message-Id: <46398@oliveb.olivetti.com>
	References: <8908082020.AA17430@ee.ecn.purdue.edu>, <832@sbsvax.UUCP>
	Sender: info-gcc-request@prep.ai.mit.edu
	To: info-gcc@prep.ai.mit.edu
	
	Perhaps this is heretical, but as soon as the body of a procedure
	written in "C" is more than 50% ASM statements, mightn't it better be
	written in assembler?  It certainly isn't portable (so writing in "C"
	isn't winning you anything there), and if you're writing it with ASMs in
	C you're vulnerable to future changes in the compiler or the
	optimizer.  What on earth is the point?  It would be different if
	every single program ever written had a device driver in it, but in
	practice, most don't.  The example in the previous post on this subject
	wasn't even a device driver -- it was just a bit of glue code, and the
	author even knew what assembler instructions he wanted the compiler to
	emit.  Why didn't he just write them himself?  I'm really baffled.
	
	And yes, I have worked on a device driver before, and it was written
	in assembler, and the bug got fixed, and I didn't go blind or crazy.
	
	David