This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
inline asm literal constraints
- From: Marc Tardif <marc at sitepak dot com>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 28 Dec 2002 02:07:49 -0500
- Subject: inline asm literal constraints
OS: Linux 2.4.13 i686
gcc: 2.96
When defining inline asm statements, it does not seem possible to
specify literal constraints. For example, if I have the variable
"offset" which contains the value "4", there is no way to use this
literal value in the following:
asm ("jmp *%0(%eax)" : : "n" (offset));
This will generate the following code, which is incorrect:
jmp *$4(%eax)
Instead, this should generate the following code:
jmp *4(%eax)
The problem is that there doesn't seem to be a constraint variable for
specifying literal values instead of immediate values.
Marc - Sitepak