I am now practicing assembly codes mixed with c++ codes, and I can compile the mixed codes for win32 platform without any problem as the following codes illustrate:
int main()
{
char alphabet = 'X';
printf ("Type letter = ");
__asm
{
mov ah, 02
mov dl, [alphabet]
int 21h
}
printf ("\n");
return (0);
}
However, when I try to compile the above codes for x64 platform, it fails. The error message I have got is as follows:
error C4235: nonstandard extension used : '__asm' keyword not supported on this architecture
I use VC2010 for compiling, and I was wondering why VC2010 does not support assembly language compiling and what I should do in this situation. Thanks!
The compiler simply does not support inline assembly in 64-bit code.
Your options:
And as it's been mentioned, chances of int 21h function 2 working in a Windows program are exactly zero. That API is only available to DOS programs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With