Hi,
I'm attempting to convert an opensource project from GCC to Visual Studio Express C++. I have almost everything compiling, except the inline asm code. I am a beginner in C++, so some of my questions may be "duh!". I have spent time Googling and reading tutorials, and still have not solved all the compile errors.
In GCC C++ inline ASM, the code is contained within
In VS C++ it is
Then there is the issue of line returns '\n' being required for GCC but apparently not for VS...
So... when using a header '#define' statment that incorporates an asm statement, how should it be converted?
Original:
Code:
#define GOrgueMemset(where, what, howmany) asm("\n\tcld\n\trep\n\tstosl\n" : : "D" (where), "a" (what), "c" (howmany))
Converted?
Code:
#define GOrgueMemset(where, what, howmany) __asm{ tcld trep tstosl : : "D" (where), "a" (what), "c" (howmany)}
But then there is this error:
error C2400: inline assembler syntax error in 'opcode'; found 'trep'
So something in there is not right.
Next issue, another #define from the header, this later gets called from another __asm statement - and I have no clue what to remove.
Code:
#define ASM_DECODE_SU(z) " \n\
movq (%0,%1),%%mm3 \n\
addl $8,%1 \n\
movq %%mm3,%%mm1 \n\
psubsw %%mm2,%%mm3 \n\
movq %%mm1,%%mm2 \n\
"
Any comments, help, links to read, etc. welcome.
GrahamG
Johannesburg, South Africa