Sender: nate AT cartsys DOT com Message-ID: <35DF1E88.A56008D2@cartsys.com> Date: Sat, 22 Aug 1998 12:39:52 -0700 From: Nate Eldredge MIME-Version: 1.0 To: Endlisnis CC: djgpp AT delorie DOT com Subject: Re: ASM References: <35D9917C DOT E3FD9686 AT unb DOT ca> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk Endlisnis wrote: > > Is there any way to load a variable into a register without putting it > in the 'input registers' section? Yes, just as you describe. > int add(int a, int b) > { > int Ret; > asm ("movl ?a?, %%eax;" > "addl ?b?, %%eax;" > : : "=a" (Ret): "%eax"); > return Ret; > > Do I have to tell it I killed eax when it was used as an output > register? No. You may need to add `&' to the constraint, however, so it doesn't put any input operands there. -- Nate Eldredge nate AT cartsys DOT com