This is somewhat off-topic, but I figure if anyone can answer it, you guys
can. Thanks.

==========

Ok, you smart guys, how do I get the upper 32 bits of a number when using
a 32-bit compiler? I.e., >> 32 would work on a 64-bit system, but you
can't do that on an x86, right?

Here's an example using a "Watcom" compiler:

/*------------------------------------------------------------------------*
  BIGMUL -> 32bit * 32bit = 64bit. We need the upper 32 bit.
            On a 64-bit compiler, it would be (num1 * num2) >> 32;
 *------------------------------------------------------------------------*/
int BIGMUL(int a, int b);
#pragma aux BIGMUL = \
  "imul  edx"        \
  parm [eax] [edx]   \
  value [edx];


How I rewrite this for gcc?

Thanks!

-Jay

Reply via email to