Solved

C++ and Assembler languages

Posted on 1999-01-14
23
423 Views
Last Modified: 2010-04-02
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.
0
Comment
Question by:Armandito
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 9
  • 4
  • +1
23 Comments
 
LVL 22

Expert Comment

by:nietod
ID: 1182150
You can use Microsoft MASM, it is available from microsoft.  Also Borland sells TASM, but it is not as good.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1182151
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
 
LVL 86

Expert Comment

by:jkr
ID: 1182152
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Armandito
ID: 1182153
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
 
LVL 5

Expert Comment

by:scrapdog
ID: 1182154
NASM (Netwide Assembler) is a freeware assembler that doesn't second-guess the programmer (by optimizing).
0
 
LVL 5

Expert Comment

by:scrapdog
ID: 1182155
By the way, MASM *doesn't* come with Visual Studio.  You have to purchase it separately (as far as I know).
0
 

Author Comment

by:Armandito
ID: 1182156
scrapdog, where can I get NASM?
0
 
LVL 5

Expert Comment

by:scrapdog
ID: 1182157
0
 
LVL 5

Expert Comment

by:scrapdog
ID: 1182158
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
 

Author Comment

by:Armandito
ID: 1182159
Ok.  I'm gonna give you the points, but I have a question.  Can NASM produce executable files for win 95 or 98?

0
 
LVL 5

Expert Comment

by:scrapdog
ID: 1182160
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
 

Author Comment

by:Armandito
ID: 1182161
I need to know if I can create executables with NASM.  The links you provided didn't mention it.
0
 
LVL 5

Expert Comment

by:scrapdog
ID: 1182162
Yes.
0
 

Author Comment

by:Armandito
ID: 1182163
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
 
LVL 5

Accepted Solution

by:
scrapdog earned 100 total points
ID: 1182164
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
 

Author Comment

by:Armandito
ID: 1182165
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
 
LVL 5

Expert Comment

by:scrapdog
ID: 1182166
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
 

Author Comment

by:Armandito
ID: 1182167
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
 
LVL 5

Expert Comment

by:scrapdog
ID: 1182168
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
 
LVL 22

Expert Comment

by:nietod
ID: 1182169
>> 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
 

Author Comment

by:Armandito
ID: 1182170
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
 
LVL 22

Expert Comment

by:nietod
ID: 1182171
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
 

Author Comment

by:Armandito
ID: 1182172
Oh, Ok.
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question