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? |
sorry for this stupid question. it should be:
asm("mov %0=r12;;":"=r"(esp)); |
All times are GMT -5. The time now is 03:17 PM. |