Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbatt!ihnp4!inuxc!pur-ee!uiucdcs!uiucdcsb!johnston From: johnston@uiucdcsb.UUCP Newsgroups: comp.lang.c++ Subject: Problem with asm()s in inlines Message-ID: <165700003@uiucdcsb> Date: Fri, 23-Jan-87 17:51:00 EST Article-I.D.: uiucdcsb.165700003 Posted: Fri Jan 23 17:51:00 1987 Date-Received: Wed, 28-Jan-87 19:57:47 EST Lines: 35 Nf-ID: #N:uiucdcsb:165700003:000:1183 Nf-From: uiucdcsb.cs.uiuc.edu!johnston Jan 23 16:51:00 1987 I think I've discovered a bug in the way cfront handles asm's in inlines. I first noticed it using version 1.1 which I had ported to our Encore Multimax (UMAX 4.2). I first assumed that I had subtly botched the build in some way, but the older version 1.0 compilers on our VAX 11/780 (4.3bsd) and 3B2s do the same thing. Here's some code to illustrate the problem: C++ source code: inline void Barney() { asm(" op src,dst"); } void Fred() { Barney(); } C code for Fred() generated by cfront: int Fred () { { asm("rney"); } } Any ideas? Notice that "rney" is part of "Barney", the name of the inline function. I'd like to be able to generate inline assembly language in some very low-level routines which need to be fast (i.e., I don't want the subroutine call overhead and I *need* access to specific processor instructions (like setting bits in the PSR to enable/disable interrupts, etc.). Thanks. - Gary Johnston Department of Computer Science University of Illinois at Urbana-Champaign 1304 West Springfield Avenue Urbana, IL 61801 Phone: (217) 333-2518 USENET: {pur-ee,convex,inhp4}!uiucdcs!johnston ARPA: johnston@b.cs.uiuc.edu CSNET: johnston%uiuc@csnet-relay