defining an asm inline function that returns long long

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

defining an asm inline function that returns long long

965 Views
ldg
Contributor II

I need to define an inline asm function that returns a long long for SC3850. In the asm_header a "return in $<your register here>" has to be specified. The function looks something like this:

 

long long asm f(int a, int b)

{

asm_header

    .arg

    _a in $d0;

    _b in $d1;

    return in <your register here>;

asm_body

    ...

asm_end

}

 

Normally something like "$d0" is provided in the "return in" clause, but since long longs are passed/returned in register pairs the syntax would have to be a little different. I've tried a number of things and all of them fail with a syntax error:

 

    return in $d0:$d1;

    return in $d0,$d1;

    return in $d0-$d1;

 

I've tried specifying only one register too, but the compiler knows that isn't a match for returning a long long.

 

Does anybody know if there's a way to do this?

 

I'm using CW 10.2.X for StarCore SC3850.

 

Thanks in advance!

Labels (1)
Tags (2)
0 Kudos
0 Replies