From owner-freebsd-questions@FreeBSD.ORG Mon Jun 18 05:42:29 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 54CAA16A400 for ; Mon, 18 Jun 2007 05:42:29 +0000 (UTC) (envelope-from tedm@toybox.placo.com) Received: from mail.freebsd-corp-net-guide.com (mail.freebsd-corp-net-guide.com [65.75.192.90]) by mx1.freebsd.org (Postfix) with ESMTP id 1877513C448 for ; Mon, 18 Jun 2007 05:42:28 +0000 (UTC) (envelope-from tedm@toybox.placo.com) Received: from TEDSDESK (nat-rtr.freebsd-corp-net-guide.com [65.75.197.130]) by mail.freebsd-corp-net-guide.com (8.13.8/8.13.8) with SMTP id l5I5gRSF021582; Sun, 17 Jun 2007 22:42:28 -0700 (PDT) (envelope-from tedm@toybox.placo.com) From: "Ted Mittelstaedt" To: "Patil, Kiran" , Date: Sun, 17 Jun 2007 22:43:56 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1896 In-Reply-To: <4AFE4AEEFA305C4BB82F73F4D819506001B50C43@orsmsx420.amr.corp.intel.com> Importance: Normal X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (mail.freebsd-corp-net-guide.com [65.75.192.90]); Sun, 17 Jun 2007 22:42:28 -0700 (PDT) Cc: Subject: RE: Need help with GNU assembly X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jun 2007 05:42:29 -0000 http://user.nj.net/~tms/hello.html > -----Original Message----- > From: owner-freebsd-questions@freebsd.org > [mailto:owner-freebsd-questions@freebsd.org]On Behalf Of Patil, Kiran > Sent: Thursday, June 14, 2007 2:11 PM > To: freebsd-questions@freebsd.org > Cc: Patil, Kiran > Subject: Need help with GNU assembly > > > Hi All, > > > > I am trying to use GNU assembly. I am trying simple thing such as , > moving content of memory location into general purpose register (ax). > > > > I have following code : > > > > struct context { > > > > unsigned long mask[8]; > > } CONTEXT; > > > > int main() > > { > > CONTEXT sr; > > sr.mask[5] = 0x8FED; > > > > __asm ( "movw %0, %ax" : : "m" (*(unsigned > short*)sr.mask[5]) ); > > return 0; > > } > > > > Compiler complains with error "bad substitution directive in asm > instruction". > > > > I tried changing the code something like this : > > > > __asm ( "movw %0, %ax" : : "m" (*(unsigned short*)sr.mask+5) ); > > > > Still error is same, then I tried following: > > > > Unsigned short* ptemp = &sr.mask[5]; > > __asm ( "movw %0, %ax" : : "m" (*(unsigned short*)ptemp) ); > > But still no luck, compiler reported same error as mentioned above > > > > Any help is appreciated. Please let me know where I am mistake. > > > > Thanks, > > -- Kiran P. > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org" > >