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.
ArmanditoAsked:
Who is Participating?
 
scrapdogConnect With a Mentor Commented:
Here is the specific chapter for writing Win32 code:

http://www.web-sites.co.uk/nasm/docs/nasmdoc8.html

Most likely you will be linking it with C...like I said, it is very *rare* to see a Win32 program written entirely in assembly language...I have only seen it once or twice, and these were just demo programs.

It might be very confusing to read this until you understand assembly language.  I would recommend reading The Art of Assembly Language (the link to the book I gave you above), at least the first half of it, before you begin to *try* to understand the process of writing an assembly language program.  I also recommend that you read Art of Asm as soon as possible, since the server there tends to go in and out, and you may not be able to access it for a couple of weeks before it is rebooted.  Right now it seems to be online.

If you are taking a class on assembly language, chances are that you will write small programs for DOS for learning purposes.  If you will be writing practical programs (which most classes do not), you will most likely be integrating your code with another language in Windows (e.g. Visual C++).  Interfacing assembly language programs with Windows is much tougher, and the red tape that goes along with it will take a semester to learn in itself!!
0
 
nietodCommented:
You can use Microsoft MASM, it is available from microsoft.  Also Borland sells TASM, but it is not as good.
0
 
nietodCommented:
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.
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
jkrCommented:
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'
0
 
ArmanditoAuthor Commented:
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!
0
 
scrapdogCommented:
NASM (Netwide Assembler) is a freeware assembler that doesn't second-guess the programmer (by optimizing).
0
 
scrapdogCommented:
By the way, MASM *doesn't* come with Visual Studio.  You have to purchase it separately (as far as I know).
0
 
ArmanditoAuthor Commented:
scrapdog, where can I get NASM?
0
 
scrapdogCommented:
0
 
scrapdogCommented:
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.
0
 
ArmanditoAuthor Commented:
Ok.  I'm gonna give you the points, but I have a question.  Can NASM produce executable files for win 95 or 98?

0
 
scrapdogCommented:
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/
0
 
ArmanditoAuthor Commented:
I need to know if I can create executables with NASM.  The links you provided didn't mention it.
0
 
scrapdogCommented:
Yes.
0
 
ArmanditoAuthor Commented:
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?
0
 
ArmanditoAuthor Commented:
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!
0
 
scrapdogCommented:
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.
0
 
ArmanditoAuthor Commented:
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?

0
 
scrapdogCommented:
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.
0
 
nietodCommented:
>> MASM will not support Visual C++ 6.0,
In what way?  You can create programs that contain MASM and VC 6 code linked together.
0
 
ArmanditoAuthor Commented:
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.

0
 
nietodCommented:
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.
0
 
ArmanditoAuthor Commented:
Oh, Ok.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.