Inline-assembly with C-code and structures

Pasi Kärkkäinen pasik@iki.fi
Sat Jul 7 07:02:00 GMT 2001


Hello!

How do I use structures defined in C-code in inline-assembly?

Basically I'd like to load a pointer of some struct to ESI. Then I'd like
to address some variables of that struct using ESI and the index
(immediate?). Now, I'd like gcc to generate that immediate for me when I
use the name of the variable of the struct in inline-asm.

Something like this: "movl struct_foo.variable_bar(%esi), %ebx"

Any ideas?

I'm using Debian GNU/Linux on x86.


- Pasi Kärkkäinen


                                   ^
                                .     .
                                 Linux
                              /    -    \
                             Choice.of.the
                           .Next.Generation.



More information about the Gcc-help mailing list