0
我在arduino中編碼,但我也在我的C代碼之間使用匯編代碼。我想計算一個價值的罪惡。到目前爲止,我有這樣的代碼:AVR內聯彙編Fsin操作數約束
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
Serial.begin(9600);
float answer;
float angle = 2;
int a = 2;
int b = 3;
asm("ADD %0,%1" : "+r"(a) : "r"(b));
asm("fsin" : "=t" (answer) : "0" (angle));
Serial.print(answer);
}
我得到這個錯誤是:在「彙編」 有趣的不一致的操作數的限制是,我不,當我刪除的最後一行(串行得到這個錯誤。打印(答案))
我還發現這個代碼爲8086彙編程序,而不是avr和8086「= t」是特定於浮動,但我找不到任何類似的avr。
在AVR上沒有像'fsin'這樣的彙編命令。這是一個C函數調用,需要像這樣處理('CALL')。 – tofro