Exception when using int 21h from inline assembly in Visual Studio

0

this is my first code using "inline" assembly in C++. I need to display a few char in the console but when run the code VS gives me

Exception thrown at 0x00DA1712 in ConsoleApplication1.exe: 0xC0000005: Access violation reading location 0xFFFFFFFF.

void print()
{
    __asm
    {
        mov DL, 10
        mov AH, 02H
        int 21H
    }
}

int main()
{

    print();
    return 0;
}
c++
windows
assembly
visual-c++
dos
asked on Stack Overflow Oct 25, 2019 by ICE FOX • edited Oct 25, 2019 by Peter Cordes

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0