From: knakasato AT aol DOT com (KNakasato) Newsgroups: comp.os.msdos.djgpp Subject: Re: asm and variables access Date: 21 Feb 1998 01:38:46 GMT Lines: 40 Message-ID: <19980221013801.UAA25772@ladder02.news.aol.com> NNTP-Posting-Host: ladder02.news.aol.com References: <34ED884D DOT 45CBA0 AT teccart DOT qc DOT ca> Organization: AOL http://www.aol.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk In article <34ED884D DOT 45CBA0 AT teccart DOT qc DOT ca>, "Jean-Réginald Louis" writes: > >How can I acces the parameter of a function and is local variable in >DJGPP when I use inline assembly (write inside that function)? > >This thing get me crazy! Whith Borland C++ 3.1, I had no problem doing >this. I thing GCC can do so! > Other than syntax that I am not used to, GCC do this better. You should get yourself NASM which isn't inline but has Intel style which I find much easier since it is more or less TASM compatible except for macros. Also I think I got this for macro from Brennan's webpage. If someone else don't give you the URL, let me know #define COPY32(dest, src, numwords) \ __asm__ __volatile__ ( \ "cld\n\t" \ "rep\n\t" \ "movsl" \ : : "S" (src), "D" (dest), "c" (numwords) \ : "%ecx", "%esi", "%edi" ) #define times3(arg1, arg2) \ __asm__ ( \ "leal (%0,%0,2),%0" \ : "=r" (arg2) \ : "0" (arg1) ); This syntax should work the same for any variables (just remove #define.) Aloha