From: Nick Newsgroups: comp.os.msdos.djgpp Subject: Re: in-line assembly syntax for GNU ASM/DJGPP Date: Sat, 01 Sep 2001 07:30:17 -0400 Organization: MindSpring Enterprises Lines: 59 Message-ID: <3B90C6C9.E48A3D44@yahoo.com> References: <09D1E9BD9C30D311919200A0C9DD5C2C03E08A5C AT mcaexc01 DOT msj DOT maxtor DOT com> NNTP-Posting-Host: a5.f7.80.d4 Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------73310BE8FB96BB02AF266908" X-Server-Date: 1 Sep 2001 11:35:28 GMT X-Mailer: Mozilla 4.73 [en] (Win98; U) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com This is a multi-part message in MIME format. --------------73310BE8FB96BB02AF266908 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit "Cappellini, Tony" wrote: > Would someone help me with the correct asm syntax for DJGPP for the > following Intel format instructions > > mov AX, OFFSET count > lea AX, count > > The gnu ASM docs are not very good for syntax examples. > > thanks for the help > > Tony why do you want it? use this code instead: __asm__ __volatile__ ( "movl %0,%%eax\n\t" "leal %1,%%eax\n\t" : : "g" ((int)&count), "m" (count) : "eax"); or if you just want raw AT&T syntax: movl $count, %eax leal count(,1), eax Except this uses eax instead of ax (since gcc is 32bit). but why do you want it? it's not like you'll able to do anything with eax. and why set eax to the same value twice? --------------73310BE8FB96BB02AF266908 Content-Type: text/x-vcard; charset=us-ascii; name="jp_prongs.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Nick Content-Disposition: attachment; filename="jp_prongs.vcf" begin:vcard x-mozilla-html:FALSE fn;quoted-printable:I set out To beg my food=3B But the time was spent Gathering violets In the fields of spring. -- Ryokan n;quoted-printable:;I set out To beg my food=3B But the time was spent Gathering violets In the fields of spring. -- Ryokan adr:;;;;;; version:2.1 end:vcard --------------73310BE8FB96BB02AF266908--