Hi
This is my first real attempt at any AT&T inline asm and this is driving me arround the bend:
asm ("movl %esp, %0": "=g" (temp) : : "memory");
I want to move a value from esp to a local variable called temp but I get this error:
operand number missing after %-letter
What am I doing wrong?
thanks
srg
Simple AT&T ASM Prob
Re:Simple AT&T ASM Prob
asm ("movl %%esp, %0": "=g" (temp) : : "memory");srg wrote: asm ("movl %esp, %0": "=g" (temp) : : "memory");
...
operand number missing after %-letter
AT&T sucks.
Re:Simple AT&T ASM Prob
Well I'm still concidering coding any assembly as seperate routines in NASM, I'm nice and familliar with that.Candy wrote:asm ("movl %%esp, %0": "=g" (temp) : : "memory");srg wrote: asm ("movl %esp, %0": "=g" (temp) : : "memory");
...
operand number missing after %-letter
AT&T sucks.
Re:Simple AT&T ASM Prob
One, GNU as (the assembler used for inline ASM in gcc) can also to Intel syntax.
Two, AT&T doesn't suck any more than any other ASM dialect, just because a user used the wrong syntax. If I forget a '$' in my Perl script, that's just as wrong and doesn't say Perl sucks.
Three, personally I consider AT&T syntax much superior because I have previous experience on 6502 and 68k CPUs - I consider Intel syntax to be seriously broken.
Two, AT&T doesn't suck any more than any other ASM dialect, just because a user used the wrong syntax. If I forget a '$' in my Perl script, that's just as wrong and doesn't say Perl sucks.
Three, personally I consider AT&T syntax much superior because I have previous experience on 6502 and 68k CPUs - I consider Intel syntax to be seriously broken.
Every good solution is obvious once you've found it.
Re:Simple AT&T ASM Prob
In a broken way, with still most of the same problems Intel-syntax people had with at&t syntax.Solar wrote: One, GNU as (the assembler used for inline ASM in gcc) can also to Intel syntax.
I wasn't referring to the user error but more to the unintuitive (yes, I know it's only past experience, don't flame me now) concept of using one percent-sign with registers, but if you use arguments you have to modify them all to use 2 percent signs.Two, AT&T doesn't suck any more than any other ASM dialect, just because a user used the wrong syntax. If I forget a '$' in my Perl script, that's just as wrong and doesn't say Perl sucks.
I can understand that, have done 68HC11 programming myself. Still, for x86es the intel syntax is lots better (imo). I still can't figure out how exactly to encode a sib operation in AT&T syntax, but in intel syntax its just [xxx] with on the place of XXX some addition of some operands you'd like. Lots more intuitive than a 8(ebx, eax, 4) something to me...Three, personally I consider AT&T syntax much superior because I have previous experience on 6502 and 68k CPUs - I consider Intel syntax to be seriously broken.