Mail Archives: djgpp/1998/12/02/05:02:58
>Tal Lavi wrote:
>>
>> Just a couple of misc questions, thanks in advance:
>>
>> 1)Can I define an extended asm command as a macro,
>> with one of the outputs value returned?
>You can, using GCC's statement-expressions extension. Example:
>#define TEST_BIT(n, b) ({ \
> char c; \
> asm("btl %1, %2; " \
> "setcb %0" \
> : "=rm" (c) \
> : "rI" (b), "rm" (n)); \
> c; \
>})
I'm sorry, but that's not really that clear.
I checked the info's, but I'm still not that sure what "rI", "rm" does
I *think* that rI is a register which holds an integer value, but what does
"rm" do?
Even more vague is the extended ASM used in sys/farptr.h:
{
__asm__ __volatile__ ("movw %w0,%%fs \n"
" .byte 0x64 \n"
" movw %w1,(%k2)"
:
: "rm" (selector), "ri" (value), "r" (offset));
}
Can anyone tell me what does
%w0 , %w1, %k2 & .byte 0x64 means?
Is there a complete extended asm giude somewhere?
The ones I found, explains only the basics.
Tal Lavi ranla AT post DOT tau DOT ac DOT il
- Raw text -