This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Howto reference a table in a structure in assembler
- From: Greg Smith <rys at epaibm dot rtpnc dot epa dot gov>
- To: gcc-help at gcc dot gnu dot org
- Cc: rys at epaibm dot rtpnc dot epa dot gov
- Date: Thu, 16 Nov 2006 15:33:58 -0500
- Subject: Re: Howto reference a table in a structure in assembler
- References: <455CB602.8000706@epaibm.rtpnc.epa.gov>
clobbering %eax. I would like to do instead (if I have to do it in
assembler):
movzbl 1(%eax),%ecx
jmp *tab_a7(%ecx,%edx,4)
Well, almost there. My routine looks like
__asm__ (
"movzbl 1(%%eax),%%ecx\n\t"
"jmp *%0(%%ecx,%%edx,4)"
: : "i" (offsetof(x, tab_a7))
);
But this generates `jmp *$1540(%ecx,%edx,4)'
instead of `jmp *1540(%ecx,%edx,4)'
which asm doesn't like.
Is there some constraint available so I don't get the $
Greg Smith