#include<iostream> using namespace std; int main(){ int a = 3; int b = 5; int c = 0; __asm__ __volatile__("mov %1,%0":"=r"(c):"r"(b));//%0 --> c ; %1 --> b cout << "a := " << a << endl; cout << "b := " << b << endl; cout << "c := " << c << endl; return 0; }
a := 3 b := 5 c := 5