Click to See Complete Forum and Search --> : C++ and assembly


blob
April 27th, 1999, 11:34 PM
I write this litle prog. with Visual C++ 6.0
Introductory Edition.
void main()
{
__asm
{
mov ah,0x02
mov dl,0x42;// B
int 0x21
mov ah,0x4c
int 0x21
}
}
I think that should do this
print B and close the prog.
It compile, it link, 0 error and 0 warning.
when I execute, a blue screen appear saying that the
prog do something wrong,
WHY.
THANKS.

Jerry Coffin
April 30th, 1999, 09:38 PM
You're trying to make DOS calls under Win32. Win32 isn't DOS, so this won't ever work. To write a character to the screen, you look up WriteFile, WriteConsoleOutput and/or WriteConsoleOutputCharacter.



The universe is a figment of its own imagination.