CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    2

    C++ and assembly

    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.



  2. #2
    Join Date
    May 1999
    Posts
    123

    Re: C++ and assembly

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured