Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- volatile byte v = 2;
- volatile byte cnt = 5;
- void setup()
- {
- Serial.begin(9600);
- asm(
- "1: \n"
- "lsl %0 \n"
- "dec %1 \n" // reg %1 face "--"
- "brne 1b \n" // daca nu e egal cu 0 sari la 1 (b = backward)
- : "+r" (v): "r" (cnt)
- );
- Serial.println(v); // 2<<5 = 2 * (2*2*2*2*2) = 64
- }
- void loop(){}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement