使用DJGPP与编译器gpp和intel语法
如何将变量传递给内联汇编?
错误如下:
对“n' 的未定义引用”
代码:
use XX\XX\Base;
class XX extends Base {
}
答案 0 :(得分:1)
djgpp uses the gcc constraint system for extended asm.
void geninterrupt (int n) {
__asm__ __volatile__("mov byte ptr [genint+1], al\n\t"
"genint: int 0" : : "a" (n));
}
You will need to list the clobbered registers if the interrupt changes any.