From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Slaby Subject: Re: How to move two valuables to x86 CPU register ebx, ecx by using AT&A inline asm. Date: Fri, 20 Nov 2009 09:45:06 +0100 Message-ID: <4B065712.4050202@gmail.com> References: Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=Vrg71SjtqtFaiPS8DutUaNAWUq6C9Le4ugpuOoRudVM=; b=CtPbQzkk50iQZTdkqqpp3fr57Amt1IGl/bamD4MFwzKt1D1iUnGXBwt4/ScOKasFu5 ORp1LeCfAAhznSOm5VTQ31yze9NAQenYtCOnJgz+SX5dd77LJlV2RzZRn5VDF7xOxwyC lh6SdkNyojs0mb4d2n8R2OKtsktfYsSvvquDc= In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Johnny Hung Cc: kernelnewbies@nl.linux.org, linux-kernel@vger.kernel.org, linux-embedded@vger.kernel.org On 11/19/2009 10:50 AM, Johnny Hung wrote: > Hi All: > I want to move two local valuables to x86 arch CPU ebx, ecx > register and do outb cpu instruction by using AT&A inline asm in > kernel driver. The following code was I wrote but gcc report syntax > error: > == > unsigned int val = 10; > unsigned int tmp = 5; > .... > __asm__ volatile ("movl %0, %%ebx" > "movl %1, %%ecx" > "outb $0x27, $0xb2" > : > :"r"(val), "r"(tmp) > :"%ebx", "%ecx" > ); > > Does anyone can point me out. Any reply is appreciated. Why not just: ("outb $0x27, %%al" : : "a" (0xb2), "b"(val), "c" (tmp)); -- js Faculty of Informatics, Masaryk University Suse Labs, Novell