问题
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