Link to home
Start Free TrialLog in
Avatar of Armandito
Armandito

asked on

C++ and Assembler languages

I am taking C++ and Assembler this semester.  I bought MS Visual Studio 6.0.  I know that I use Visual C++ to program in C++, but what would I use to program in Assembler?
Thanks.
Avatar of nietod
nietod

You can use Microsoft MASM, it is available from microsoft.  Also Borland sells TASM, but it is not as good.
For short segments of assembly (not whole programs, but like assembly procedures) you can use inline assembly in VC.  However this is not like a full featured assembler, so you probably can't get but with it alone.
Avatar of jkr
Perhaps the GNU project might also be worth to check out - 'as' (the GNU assembler) is free, as the GNU C/C++ compilers (gcc and g++) and lots of other useful software - see 'http://www.cygnus.com/misc/gnu-win32/ The GNU-Win32 Project Page'
Avatar of Armandito

ASKER

All the answers have been good.  Since Nieto was first I feel inclined to give him the points.  But I need to ask for more information before the answer is right.  
Does Microsoft MASM come with Visual Studio 6.0 Pro?
Thanks!
NASM (Netwide Assembler) is a freeware assembler that doesn't second-guess the programmer (by optimizing).
By the way, MASM *doesn't* come with Visual Studio.  You have to purchase it separately (as far as I know).
scrapdog, where can I get NASM?
And there is an excellent online assembly language book at:

http://webster.ucr.edu/Page_asm/ArtofAssembly/ArtofAsm.html

1500 pages!!  Very easy to read.
Ok.  I'm gonna give you the points, but I have a question.  Can NASM produce executable files for win 95 or 98?

Yes, but I have never done so.  It is rare for someone to make an .exe out of pure assembly language.  Most of the time the assembly language code is assembled into an object files, and the executables are made out of a combination of the object files and another high level language (such as c or pascal).  However, it IS possible to make an executable out of pure assembly language.

You can read the docs for details.

http://www.web-sites.co.uk/nasm/docs/
I need to know if I can create executables with NASM.  The links you provided didn't mention it.
Yes.
Hey, sorry about that.  My browser must not have refreshed correctly so I didn't see your latest comment.  How do I give you the points?
ASKER CERTIFIED SOLUTION
Avatar of scrapdog
scrapdog
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hey, gimme an opinion.  I found out from someone else that Microsoft's MASM is also downloadable.  Which do you recommend?  MASM or NASM?  About making EXE's, our professor said we'll be doing that.  Thanks a lot for your help!
I don't know for sure if MASM is free, so I don't know.
I do know that MASM requires a lot of directives, which can make it very confusing.  NASM lets you build programs without using the directives but gives you the option of doing so.  So for ease of use I would probably say NASM.  MASM probably has less bugs however.  I really don't know.  Download both and see which you like better.

By the way, the online book assumes you are using MASM.  I am not exactly sure, but NASM may be compatible with MASM.
Scrapdog, I have just downloaded both.  I'm not installing either of them quite yet.  But it looks like I will go with NASM because I was reading some documentation for MASM and MASM will not support Visual C++ 6.0, which is what I have.  Do you know of any compatability issues with NASM, Win98, and VC++6.0?

Nope, I don't, because I normally don't use Visual C++.  You could look through the NASM website.  My guess is that if it doesn't now, it will soon.  NASM seems to be an ongoing project.
>> MASM will not support Visual C++ 6.0,
In what way?  You can create programs that contain MASM and VC 6 code linked together.
Nieto, go to this link.

http://www.microsoft.com/ddk/1ddk98.htm

It is the Info page for MS Win98 Device Driver Kit (DDK).
Supposedly the MASM comes with the DDK.  Now look on that page under system requirements for installation.  It says "Microsoft Visual C++ 6.0 is not currently supported."
I don't know how or in what way.

The DDK doesn't support VC 6.  That has nothing to do with MASM  All that means is that you can't write a device driver with VC 6 and the DDK.  

MASM neither supports or doesn't support VC 6.  They have nothing to do with each other in tha way.
Oh, Ok.