* H. Peter Anvin (hpa@xxxxxxxxx) wrote:Mathieu Desnoyers wrote:* H. Peter Anvin (hpa@xxxxxxxxx) wrote:That's right.Mathieu Desnoyers wrote:Ah! yep, I see, so we say:For "char" (8-bit) values, sp/bp/si/di are illegal in 32-bit mode.- Use "=g" constraint for char immediate value inline assembly.q
"=g" is the same as "=rmi" which is inherently bogus. In your actual code you use "=r", the correct constraint is "=q".
Any register accessible as rl. In 32-bit mode, a, b, c, and d; in 64-bit mode, any integer register. I am worried that "=q" might exclude the si and di registers in 32-bit mode.
What exactly is wrong with "=r" ?
Hence "=q".
1 byte : "=q"
2 bytes : "=r"
4 bytes : "=r"
8 bytes : "=r"
? (si and di appear to be legal for 2 and 4 bytes in 32-bit mode)
-hpa