使用例
- mipsで SRレジスタの値をCの変数srに読み出す。
asm("mfc0 %0,$12": "=r" (sr));
- H8で、spの値をCの変数 sp_valに読み出す。
asm("mov.l sp,%0" : "=r" (sp_val));
- H8で、割込み許可フラグを操作
#define save_flags(x) asm("stc.b ccr,%0l" : "=r" (x))
#define restore_flags(x) asm("ldc.w %0l,ccr" :: "r" (x))
情報源
更新履歴
|