Mail Archives: djgpp/2003/07/23/09:34:37
> __asm__ __volatile__(
> "movw %w0, %%fs\n"
> ".byte 0x64 \n"
> "movb %b1, (%k2)"
> :
> : "rm" (selector), "qi" (value), "r" (offset));
> }
> Looking at the "rm" (selector) and "movw %w0, %%fs" parts, I assume
> that this allows selector to be placed directly into the fs register,
> right?
Yes. It can be copied from a register ("r") or an immediate value can
be used ("i").
> Also, "qi" (value) moves value directly into al?
"value" gets put into either al, bl, cl, dl ("q"), or an immediate
value can be used ("i").
"offset" is put into any 16-bit register (ax, bx, si, etc) ("r").
In both cases, the compiler will use whatever selection is optimal for
the program.
The "b" in "%b1" means it's a byte. The "k" in "%k2" means it's a
dword (4 bytes).
- Raw text -