Advertisement
CosminVarlan

19. Increment by 1 - varianta cu carry(ASM)

Dec 16th, 2021
1,212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. volatile int x=255;
  2.  
  3. void setup()
  4. {
  5.   Serial.begin(9600);
  6.   asm(
  7.     "ldi r24, 1 \n"
  8.     "add %A0, r24 \n"
  9.     "ldi r24, 0 \n"
  10.     "adc %B0, r24 \n"    
  11.     :"+r" (x)::"r24"
  12.   );  
  13.   Serial.println(x);
  14. }
  15.  
  16. void loop(){}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement