hi @ all,
i try to compile this source code under suse linux with gcc, but there are errors, here the source:
asm(" mov eax, 0");
asm(" CPUID");
asm(" mov [REGEBX], ebx");
asm(" mov [REGECX], ecx");
asm(" mov [REGEDX], edx");
this source is inline asm...
here the errors:
Error: too many memory references for mov
Error: invalid char '[' beginning operand 1 [REGEBX]
and so on....
i think the syntax is not correct, can you help me ???
thanks, by. matze
problem with assembler source
Re:problem with assembler source
Are you sure this is inline asm? Cause it looks like NASM to me.
Re:problem with assembler source
hi, oh sorry, i mean the source is in nasm, i need it for gcc. now, when i want to compile it with gcc, there are errors.
thanks, by.matze
thanks, by.matze
Re:problem with assembler source
GCC uses the AT&T syntax...you can find links on google on how to use that assembler syntax...or to get partial NASM syntax use this macro I made:
#define inasm(s) asm(".intel_syntax no_prefix"); asm(s); asm(".att_syntax prefix");
#define inasm(s) asm(".intel_syntax no_prefix"); asm(s); asm(".att_syntax prefix");