Using int 21h with inline assembly

99封情书 提交于 2019-12-11 07:36:53

问题


I am using inline assembly in Visual C++ and have been trying for days now to get int 21h to work with my program. Other interrupts work (int 3) which leads me to believe either I'm calling 21h wrong or it is blocked somehow. I only get a runtime error when I use int 21h. If I comment it out it can move registers fine.

So far I've gotten this together:

int _tmain(int argc, _TCHAR* argv[])
{
    __asm {
        mov ah, 1h
        int 21h

        mov dl, al
        mov ah, 2h
        int 21h
    }
}

回答1:


You can't use DOS interrupts in a windows program; they are different platforms

You can use hardware interrupts such as int 1 and int 3.



来源:https://stackoverflow.com/questions/9524388/using-int-21h-with-inline-assembly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!