Mail Archives: djgpp/1998/02/20/23:00:10
In article <34ED884D DOT 45CBA0 AT teccart DOT qc DOT ca>, "Jean-Réginald Louis"
<louis DOT jean-reginald AT teccart DOT qc DOT ca> 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
- Raw text -