CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: Assembler

  1. #1
    Join Date
    May 2001
    Location
    israel
    Posts
    99

    Assembler

    hello,

    can i use the Ms visual Studio to write programs in assembler??
    if so how do i do that?

    (i am not intrested in writing assembler code inside a c++ program
    but writing a full assmbler program and compile it using the Microsoft visual studio)

    thanks,
    ohad.

  2. #2
    Join Date
    Jun 2002
    Posts
    1,417
    no. you need masm, or tasm, or some other assembler to do that.

  3. #3
    Join Date
    Jun 2002
    Location
    Germany
    Posts
    1,557
    ohadbp:

    Are you interested in mixing pure asm-files with C/C++ files?

    This can be done easily with VC6 as well as VC.NET. I can provide you with a sample project if you want.

    Chris.
    You're gonna go blind staring into that box all day.

  4. #4
    Join Date
    Jun 2002
    Location
    Germany
    Posts
    1,557
    Hello,

    Various developers wanted the above-mentioned sample project which integrates pure assembly files into the Dev.-Studio environment.

    Here is one of them ("cpuid"). The program does some rudimentary identifications of the Pentium CPUID (See http://www.intel.com/design/xeon/applnots/241618.htm).

    The netwide assembler nasm is used (homepage seems to have moved, can't find it right now). You must download the windows version of nasm called nasmw.exe from somewhere: It makes the zip-archive too big for this forum.

    There are Projects for VC1.52 (pure DOS, 16-bit), VC.6 (32-bit Win32), VC.NET (32-bit Win32).

    This software is primarily for educational purposes, no guarantees here. The project is very old and should not be taken as a treatise on the sensible use of C++.

    Send private message if you have further questions.

    Good luck.
    Chris.

    Attached Files Attached Files
    You're gonna go blind staring into that box all day.

  5. #5
    Join Date
    May 2002
    Location
    Texas
    Posts
    222

  6. #6
    Join Date
    Jun 2002
    Posts
    1,417
    I downloaded cpuid.zip and nasm, loaded the project with VC6, and tried to build. It gave me an error that it could not find \nasm\... -- that's not the problem because I havn't installed it yet. My question: I can't find in Project | Settings or Tools where VC6 knows about nasm. Is there some setting someplace that tells it to use nasm when the file extension is asm?

  7. #7
    Join Date
    Jun 2002
    Location
    Germany
    Posts
    1,557
    Sorry,

    I forgot to mention anything about that. This project uses a so-called "custom build" which can be set in the Dev. Studio environment. The custom build for a given asm file fully specifies the complete command line for assembling a given asm file. The Dev. Studio environment recognizes the created obj file and links it automatically (the output should have the extension .obj).

    Everything in the project posted yesterday is already setup to run properly. Make sure that "nasmw.exe" is in the project "nasm" directory (i.e. ...\cpuid\nasm\nasmw.exe). The project actually carries a local copy of nasmw.exe around with it. I bet there is a better way to manage this type of thing but it works nonetheless.

    To setup things from scratch for your projects, do the following.

    Use VC.6, English:

    Choose Project---Settings, then the dialog box with various file-settings for all the files comes up. For C/C++ files there are two tabs: One for General, one for C++. For the assembler files there are also two tabs but a bit different: One tab for General and one tab for custom build. I simply use the custom build to fully specify the build command for such asm files.

    By the way, I took the time to get the dust off the project yesterday night. The Dev.Studio 1.52 pure DOS version in the posted zip actually was out of proper working order, the others worked. A corrected version is available.

    Please let me know if you can find any improvements for managing this type of mixed-language project. Thanks.

    Chris.

    You're gonna go blind staring into that box all day.

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