VOOZH about

URL: https://qiita.com/TakeoChan/items/992026ec9e06337d97e7

⇱ Arduinoでインラインアセンブラ #fabo - Qiita


👁 Image
4

Go to list of users who liked

2

Share on X(Twitter)

Share on Facebook

Add to Hatena Bookmark

More than 5 years have passed since last update.

@TakeoChan(豪雄 永山)in👁 Image
株式会社GClue

Arduinoでインラインアセンブラ

4
Last updated at Posted at 2016-02-16

単純な足し算をする。RdとRsが足し算され、結果はRdに格納される。

addvalue.ino

void setup() {
 // put your setup code here, to run once:
 Serial.begin(9600);
 
 int val1 = 2,val2 = 3; 
 
 __asm__(
 "add %[Rd],%[Rs]"
 :[Rd] "=r" (val1)
 :[Rs] "r" (val2)
 );
 Serial.print("addvalue = ");
 Serial.println(val1);
}

void loop() {
 // put your main code here, to run repeatedly:
}


4

Go to list of users who liked

2
0

Go to list of comments

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4

Go to list of users who liked

2