Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!decvax!ucbvax!pasteur!ames!hao!gatech!purdue!i.cc.purdue.edu!k.cc.purdue.edu!l.cc.purdue.edu!cik From: cik@l.cc.purdue.edu (Herman Rubin) Newsgroups: comp.lang.c Subject: Re: Portable "asm" (Was: The D Programming Language) Message-ID: <689@l.cc.purdue.edu> Date: 27 Feb 88 11:51:56 GMT References: <11702@brl-adm.ARPA> <243@eagle_snax.UUCP> <2245@geac.UUCP> <1988Feb25.203425.8925@utzoo.uucp> Organization: Purdue University Statistics Department Lines: 38 Keywords: portable D Summary: Look at it the other way In article <1988Feb25.203425.8925@utzoo.uucp>, henry@utzoo.uucp (Henry Spencer) writes: > > If we have the compiler replace names by locations (register and/or memory) > > of the variables used... > > This does of course assume that all locations are addressable in all > instructions, which is emphatically not the case on many machines. This is another reason for the user to be able to force the compiler to put things in registers. The stupid compiler should not be able to force the user to use many instructions because it does not see the need for register variables. This applies also to such constructs as register pairs, triples, etc. Naturally, this would require some way of modifying the register number, but so what? This is simple, compared to the machinations that compilers now undertake. Also, it is rash to assume that the programmer does not make mistakes. If the location types of the arguments do not work with the instruction, this is a programming error; what are diagnostic and error messages for? > > We also should get rid of those quotes in the process... > > What if I want to write asm("mov ')', r0")? The quotes are a reasonable way > of keeping the syntax of the assembler entirely out of the compiler's own > syntax handling, which is a good thing, especially for portable compilers. Someone has posted an example where the failure was due to a " in the assembler instruction. It is just as easy, since C requires a ; to end a statement, to tell the compiler that until it sees ); to continue processing for the assembler, and to have some escape mechanism for inserting ); into the assembler statement. Alternatively, if we get rid of the ;s as mandatory terminators (which I think is a good idea), have an escape mechanism for inserting ) in an assembler statement. Is this worse than not being able to put ", or even "), in an assembler statement? -- Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907 Phone: (317)494-6054 hrubin@l.cc.purdue.edu (ARPA or UUCP) or hrubin@purccvm.bitnet