Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 03-15-2011, 06:27 AM   #1
LQ Newbie
Registered: Mar 2011
Posts: 4

Rep: Reputation: 0
error: unknown register name '%eax' in 'asm'

An error occur when I compile my inline assemble code with a alpha/linux cross compiler.

#define CPU_ID(cpu_iid)                   \
       __asm__ __volatile__ (             \
       "mov $0, %%eax\n\t"                \
       "mov %%eax, %0\n\t"                \
       :"=m"(cpu_iid)                     \
       :                                  \
       :"%eax"                            \
error: unknown register name '%eax' in 'asm'
does anyone know how to solve this problem? thanks for help.
Old 03-15-2011, 11:21 AM   #2
LQ Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 9,562

Rep: Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997
the %.

eax is a register, I think. (Did very little x86 asm). %eax is not a register.
Old 03-15-2011, 01:18 PM   #3
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
%eax is not a register
More specifically, "%eax" is not an ALPHA register - it's an x86 register.

In "as" assembler syntax (vs. "masm" assembler syntax).

This link might help:

The snippet in question is a macro that reads the CPU ID from an Intel/AMD x86 processor. As a workaround, perhaps you might just hard-code some dummy CPU ID for your Alpha port?

Last edited by paulsm4; 03-15-2011 at 01:20 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
error: asm/bitops.h: No such file or directory chronickut Linux - Newbie 3 10-04-2010 05:19 PM
[SOLVED] Why the expected =, ,, ;, asm or __attribute__ before typedef error? shawley Programming 8 02-02-2010 12:06 PM
unable to resolve compilation error;./List.c:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ amolgupta Programming 3 01-09-2009 11:09 AM
ASM x32 vs ASM x64 Tegramon Programming 3 02-27-2008 03:26 PM
SDL_mixer_MMX.c:16: error: PIC register `ebx' clobbered in `asm' BGuy891653 Linux - Software 0 12-12-2004 07:31 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:47 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration