From owner-freebsd-hackers Fri Mar 15 11:30:32 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id LAA24319 for hackers-outgoing; Fri, 15 Mar 1996 11:30:32 -0800 (PST) Received: from CRVAX.SRI.COM (CRVAX.sri.com [128.18.30.65]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id LAA24314 for ; Fri, 15 Mar 1996 11:30:25 -0800 (PST) Received: From ROCKY.SRI.MT.NET by CRVAX.SRI.COM with TCP; Fri, 15 MAR 96 11:25:47 PST Received: (from nate@localhost) by rocky.sri.MT.net (8.6.12/8.6.12) id MAA11752; Fri, 15 Mar 1996 12:32:21 -0700 Date: Fri, 15 Mar 1996 12:32:21 -0700 Message-Id: <199603151932.MAA11752@rocky.sri.MT.net> To: hackers%FreeBSD.org@sri.com Reply-To: nate@sneezy.sri.com (Nate Williams) From: nate@sneezy.sri.com (Nate Williams) Subject: GAS question Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk [ I'm bouncing this through sri.com in hopes that it gets to the mailing lists due to Sprintnet problems. Please respond to 'nate@sneezy.sri.com' (it should be setup to do that). ] Can someone explain to me the following piece of code please? I can't find *any* documentation on it, and I've stared at it long enough but still can't answer what it does definitively. Thanks! Nate -------- inline int apm_int(u_long *eax, u_long *ebx, u_long *ecx) { u_long cf; __asm ("pushl %%ebp pushl %%edx pushl %%esi xorl %3,%3 movl %3,%%esi lcall _apm_addr jnc 1f incl %3 1: popl %%esi popl %%edx popl %%ebp" : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=D" (cf) : "0" (*eax), "1" (*ebx), "2" (*ecx) ); apm_errno = ((*eax) >> 8) & 0xff; return cf; } Most of this is obvious, but these two lines completely baffle me. : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=D" (cf) : "0" (*eax), "1" (*ebx), "2" (*ecx) Obviously it sets up some sort of mapping between the variables & parameters and the assembly level registers, and some comments I've read on similar code implies that it also says something regarding optimizations (similar to volatile and const?). Please help me oh gas gurus. :) Nate