Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: comp.lang.c Subject: Re: Inline assembler; a quiz (long; sorry) Message-ID: <8253@utzoo.UUCP> Date: Mon, 6-Jul-87 13:42:27 EDT Article-I.D.: utzoo.8253 Posted: Mon Jul 6 13:42:27 1987 Date-Received: Mon, 6-Jul-87 13:42:27 EDT References: <608@zen.UUCP> <2299@hoptoad.uucp> <21211@sun.uucp> <830@omepd>, <239@sugar.UUCP> Organization: U of Toronto Zoology Lines: 19 > Not all C compilers are running on UNIX. > > Some operating systems require heavy assembly language glue around > system calls. It's so much easier to put this glue in asm statements > in 'C' source. I have news for you: Unix systems generally require assembly-language glue around system calls too, since virtually no Unix system does system calls exactly the same way it does function calls. (If nothing else, the actual call instruction almost invariably differs.) The standard solution, used by the original Unix and still used by most Unixes, is that the "system call" in C is just an ordinary function call, and the function that's called is written in assembler and does the actual system call. The original PDP-11 Unixes had grossly non-C system-call conventions and worked fine despite a C compiler that never supported "asm" at all. -- Mars must wait -- we have un- Henry Spencer @ U of Toronto Zoology finished business on the Moon. {allegra,ihnp4,decvax,pyramid}!utzoo!henry