inline Assembler

Vasili Goutas (vgo@ratio.de)
Thu, 17 Sep 1998 15:29:10 +0200


I read the "Brennam's Guide to Inline Assembly " by Brennam Underwood
and try to use some assembler code in my driver, but I get the error
message
"`asm' needs too many reloads".
The code is this:

//
// Enlarged integer multiply - 32-bits * 32-bits -> 64-bits
//
#define NTAPI

__inline LARGE_INTEGER
NTAPI
RtlEnlargedIntegerMultiply (
LONG Multiplicand,
LONG Multiplier
)
{
LARGE_INTEGER rc;
/*
rc.QuadPart = Multiplicand * Multiplier;
return rc;
*/
__asm__ __volatile__("imull %0\n\t"
: "=A"(rc.QuadPart)
: "%eax"(Multiplicand), "0"(Multiplier)
: "eax");
return rc;

/*
__asm {
mov eax, Multiplicand
imul Multiplier
}
*/
}
Its a port from NT to Linux, so don't wonder about NTAPI.

The ': "eax");' I have already changed to
': "%eax");',
': "%eax", "0");',
...
but its still the same.
Also I haven't realy understand what the clobberlist is.

I hope somebody knows more about assebler than me.
Vasili
Please CC to vgo@ratio.de

-- 

********************************************************************** * Vasili Goutas RATIO Entwicklungen GmbH * * P:+49-(0)40-369007-37 Admiralitätstr. 59 * * F:+49-(0)40-369007-25 D-20459 Hamburg * * Email: mailto:vgo@ratio.de * **********************************************************************

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/