I have a code written in pure C that uses the __asm__ keyword. I need to translate the assembly statements from something the gcc recognises into something the Visual C++ compiler will recognise. In Microsoft's C++ compiler, assembly instructions are invoked using the __asm keyword (not __asm__) and the instructions should be enclosed in curly braces {} not parentheses.
I'm not an assembler coder, please help :)
Here is the code I need to translate to Visual C++ :
# define FASTDIV(a,b) \
({\
int ret,dmy;\
__asm__ volatile(\
"mull %3"\
:"=d"(ret),"=a"(dmy)\
:"1"(a),"g"(ff_inverse[b])\
);\
ret;\
})
#define MASK_ABS(mask, level)\
__asm__ volatile(\
"cltd \n\t"\
"xorl %1, %0 \n\t"\
"subl %1, %0 \n\t"\
: "+a" (level), "=&d" (mask)\
);
uint32_t a, d;
__asm__ volatile("rdtsc\n\t" : "=a" (a), "=d" (d));
return ((uint64_t)d << 32) + a;
I'm sure it will be an easy answer for someone who has more experience in assembly coding. Thanks in advance!