View Single Post
Old Jun 23rd, 2005, 12:16 PM   #1
earl
Newbie
 
Join Date: Jun 2005
Posts: 18
Rep Power: 0 earl is on a distinguished road
Access variable within inline asm

Is there a way to access a local variable via inline assembly? I'm working on a Solaris machine with g++. What I'd like to do is this:

long myWrapper(long *value1, long value2)
{
  int tmp;

  asm(" ... "
        "st %l7 tmp"
        " ... ");

  return tmp;
}

So basically I'm going through this assembly algorithm, and the value I want to return from the function is in a particular register in the middle of the algorithm. Any thoughts? Thanks in advance.
earl is offline   Reply With Quote