LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 05-08-2006, 03:21 AM   #1
snowing
LQ Newbie
 
Registered: Jul 2005
Posts: 26

Rep: Reputation: 15
asm in gcc


I am a new bie to asm. And today I encounter a problem, but I don't know why? I use embedded asm in gcc on IA64.
The following code can work well.
asm("mov r12=%0;;"::"r"(esp-16)); //putting esp-16 to r12
but this code cannot work, when compiling it reports that
"output operand constraint lacks '=' "
asm("mov %0=r12;;":"r"(esp);//getting esp from r12
I searched this error on google, but the two results didn't bring me much hints.
And on x86_64, the situation is alomst the same, though the asm codes maybe a little different.
asm("\tmov %0, %%rsp\n" :: "r"(rsp)); //compling good
asm("\tmov %%rsp, %0\n" :"r"(rsp); //compling error
Could you please give me some suggestion?
 
Old 05-08-2006, 03:52 AM   #2
snowing
LQ Newbie
 
Registered: Jul 2005
Posts: 26

Original Poster
Rep: Reputation: 15
sorry for this stupid question. it should be:
asm("mov %0=r12;;":"=r"(esp));
 
  


Reply


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
Have you seen such asm code? snowing Programming 2 07-07-2005 05:13 AM
Linux 32 ASM introuble Programming 2 05-10-2005 06:56 AM
asm/uaccess.h eltn Programming 2 10-22-2004 06:14 PM
How to use C functions in asm? LongName Programming 4 08-29-2004 12:25 AM
asm question karlan Programming 6 07-16-2004 11:54 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:43 PM.

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