Mail Archives: djgpp/1999/05/13/19:30:38
Chuming wrote:
> Hi there, can anyone help me with the following problems:
>
> 1) when using extended inline asm in djgpp, is the input registers field
> limited
> to only 10 operands. Is there any way to get around the problem?
>
> eg:
> __asm__ __volatile__
> ("
> /* asm statements*/
> "
> :
> : "g" (x1), "g" (x2), "g" (x3)... until more than 10 inputs
> : "edi","eax","ecx","ebx","memory"
> );
Well, you can only have as many parameters as there are registers. I
really don't remember what the "g" modifier means, but I would be suprised if
there were more than 10 available registers.
> 2) Is it possible to access C local variables in inline asm?
> eg. when we're in a function...
> (void) func(int x,int y )
> {
> int z;
>
> __asm__ __volatile__
> ("
> /* can we do something like in intel asm...*/
> /* "mov [z],100" or "mov [x],255" etc...*/
> "
> );
> }
Only by loading them the way you did in the first example. If you need
more then 10 registers, you can assign some of them as "m" which is for
"memory" (I think, I haven't done this in a long time). Or you can split you
asm into smaller portions.
--
(\/) Endlisnis (\/)
s257m AT unb DOT ca
Endlisnis AT HotMail DOT com
ICQ: 32959047
- Raw text -