OSDev.org

The Place to Start for Operating System Developers
It is currently Sat Apr 27, 2024 5:33 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: problem with assembler source
PostPosted: Wed Jan 29, 2003 11:40 am 
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


Top
  
 
 Post subject: Re:problem with assembler source
PostPosted: Wed Jan 29, 2003 11:42 am 
Are you sure this is inline asm? Cause it looks like NASM to me.


Top
  
 
 Post subject: Re:problem with assembler source
PostPosted: Wed Jan 29, 2003 11:52 am 
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


Top
  
 
 Post subject: Re:problem with assembler source
PostPosted: Wed Jan 29, 2003 12:07 pm 
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");


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group