Can I use function macros inside gcc inline assembly block? -


#define mov_macro(r0,r1)\ {\     "mov r0, r1 \n\t"\                                                       }  __asm__ volatile(\     mov_macro(r4,r5)     :"r4","r5"\     );\ 

is possible use function in asm block ? if not, please suggest ways use it.

yes, it's possible, if need such functionality shouldn't using inline asm separate asm module.

#define mov_macro(r0,r1) "mov " #r0 ", " #r1 "\n\t"  void foo() { __asm__ volatile(     mov_macro(r4,r5)     ::     :"r4","r5"     ); } 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -