PDA

View Full Version : [C] Extended assembly


Unrue
15-12-2008, 09:28
Ciao a tutti,
sto cercando di richiamare la funzione seno direttamente da Assembly:

#include <stdio.h>

float asm_sin(float angle){

float result;

asm("fsinx %1,%0" : "=&f" (result) : "f" (angle));

return result;

}

int main(){

float angle = 0.5;

printf(" angolo %f seno %f",angle,asm_sin(angle));
return 0;
}

Solo che in compilazione dice:

asm.c:7: error: output constraint 0 must specify a single register

Dove sbaglio ? :confused: