djgpp gpp传递变量内联汇编

时间:2015-09-01 18:57:15

标签: gcc assembly x86 djgpp

使用DJGPP与编译器gpp和intel语法
如何将变量传递给内联汇编? 错误如下:
对“n' 的未定义引用”
代码:

use XX\XX\Base;
class XX extends Base {

}

1 个答案:

答案 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.