Thread: Assembler in c++

  1. #1
    Registered User
    Join Date
    Apr 2004
    Posts
    5

    Assembler in c++

    Hi there.

    I just wanted to know how can I use Assembler in c++.
    With this I mean: which headers do I need to include in my program; how do I call a DOS Interrupt and how do I write to a specific location in memory.

    Thanks.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Which OS and compiler do you have
    Everything you've said is heavily dependent on those
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Apr 2004
    Posts
    5
    I have Windows Millenium and I use MS Visual C++ and Dev-C++.

  4. #4
    Registered User
    Join Date
    Aug 2003
    Posts
    470
    You can't use DOS interrupts or access a specific memory location, by passing the paging, in windows.

    The last time I did assembly in C++ we took C++ classes with functions not filled in, compiled them, and then filled in the mangled function calls with assembly code. The first argument passed into a nonvirtual method function will be a pointer to the class.

  5. #5
    The Defective GRAPE Lurker's Avatar
    Join Date
    Feb 2003
    Posts
    949
    C and C++ can use assember in blocks such as this:
    Code:
    asm {
     ...
    }
    or with __asm. However, not all compilers can do this, so check your documentation. Visual C++ Version 6 I believe can compile assembler. Don't know about previous versions; I only have Visual C++.NET.
    Do not make direct eye contact with me.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem building Quake source
    By Silvercord in forum Game Programming
    Replies: 16
    Last Post: 07-11-2010, 09:13 AM
  2. Assembler in GCC
    By Magos in forum Linux Programming
    Replies: 4
    Last Post: 11-05-2002, 04:22 PM
  3. assembler and linker stuff...question
    By dirkduck in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 12-17-2001, 12:10 AM
  4. MAINFRAME Assembler.
    By sean in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 12-05-2001, 05:32 PM
  5. interfacing assembler with c++
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 10-24-2001, 12:13 AM