From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 21741 invoked from network); 16 Aug 1999 08:37:46 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 16 Aug 1999 08:37:46 -0000 Received: from piglet.twiddle.net (root@piglet.twiddle.net [207.104.6.26]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id EAA00159 for ; Mon, 16 Aug 1999 04:37:45 -0400 Received: (from rth@localhost) by piglet.twiddle.net (8.8.7/8.8.7) id BAA09042 for axp-list@redhat.com; Mon, 16 Aug 1999 01:37:44 -0700 Date: Mon, 16 Aug 1999 01:37:44 -0700 From: Richard Henderson To: axp-list@redhat.com Subject: Re: tbia() on DEC 3000 question Message-ID: <19990816013744.A8840@twiddle.net> References: <199908160724.DAA04846@neptune.phys.ufl.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.5i In-Reply-To: <199908160724.DAA04846@neptune.phys.ufl.edu>; from Craig P Prescott on Mon, Aug 16, 1999 at 03:24:38AM -0400 On Mon, Aug 16, 1999 at 03:24:38AM -0400, Craig P Prescott wrote: > #define tbia() \ > ({ \ > register unsigned long __r16 __asm__("$16") = -2; \ > __asm__ __volatile__( \ > "call_pal 0x0033" \ > : \ > : \ > :"$1", "$16", "$17", "$22", "$23", "$24", "$25"); \ This doesn't make sense; __r16 is no longer used by the asm, so the assignment should be optimized away, so $16 probably now contains garbage. > 2) why would the original tbia() fail on a DEC 3000 but work on > everything else? I have no idea. It doesn't make any sense for the PALcall to fault at all. > __tbi is generalized beyond the immediate needs of > tbia() and tbiap(); could this be causing some problem? I very much doubt it. > P.S. This is a bit off-topic, but if someone could spell out in full detail > __tbi above, I'd be grateful, as I could learn more from this > example. I.e. what do the #__tbi and ##arg1 do? Standard argument substitution from the macro -- # is stringification, ## is concatenation. > And I learned from a > gcc doc what the "=r" and "0" mean, but what about "i"? Immediate. > If one wanted to learn a bit of Alpha Assembly - > with no prior knowledge of any assembly language - what would one do? I study compiler output. r~