Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Best Assembler to go with MSVC++ 4.1

Posted on 1998-08-24
12
Medium Priority
?
289 Views
Last Modified: 2010-04-01
Not quite the right place to ask this question but...

If I want to make a program with both C and Assembler for a 32 bit application what is the best assembler to use?

It must support the latest op-codes for Pentiums.
0
Comment
Question by:icd
[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
  • 4
  • 3
  • 3
  • +1
12 Comments
 
LVL 2

Accepted Solution

by:
warmcat earned 400 total points
ID: 1171062
Use the built-in inline assember.  Upgrade to VC5 if you want the latest and greatest opcodes, not that I am aware of any missing in VC 4.
0
 
LVL 2

Expert Comment

by:warmcat
ID: 1171063
Oh dear, I see it was 100 points.  Example inline assember:

void functionMyFunction()
{
  int nMyCVariable;

_asm {

  mov al, 55h  ;// use this sequence as comment to get
  mov ebx, [nMyCVariable] ;// comment & syntax highlighting
  inc ebx
  mov [nMyCVariable], ebx
label:
  nop
  jnz  label
 }
}

I should also write a little piece of C representative of the inner loop you intend to code in assembler, compile it with all the optimizations switched on and an assembler listing enabled (Project|Settings|C/C++|Category:Listing Files|Listing File Type|Assembly,Machine Code and Source) as you may be surprised at how reasonable the code from modern compilers is for most cases.  I recently wrote some realtime signal processing application code in C on a pentium and when I checked the output found it was optimal wall-to-wall FPU instructions for hundreds of lines.

Regards,

-Andy
0
 
LVL 5

Author Comment

by:icd
ID: 1171064
Not quite what I had in mind. I did know about the _asm instruction in C but rejected it for my purpose. The main reason being it could not support the db instruction.
Having said that I have just been told about the _emit instruction which I am just about to look up.

Really, I wanted a macro assembler since I have quite a bit of assembler to write.

I will get back to you.

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 4

Expert Comment

by:agreen
ID: 1171065
>>Oh dear, I see it was 100 points
I see you're hungry :)

Also I can suggest the MASM v6.11
0
 
LVL 4

Expert Comment

by:agreen
ID: 1171066
For some tasks the external assembler is preferable (or even is a single solution) than the built-in assembler.
0
 
LVL 2

Expert Comment

by:warmcat
ID: 1171067
If you need to intertwine C/C++ assets/variables and assembler then this is the way to go.  But I would look again at the code quality produced by the compiler; in my experience the effort of handcoding all but the tightest loops has not been repaid.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1171068
>> I would look again at the code quality produced by the compiler
I wouldn't.   The code produced by the compiler is increadibly bad.  Terribly slow, inneficient, and large.  But despite that, warmcat  is right.  Even in the critical sections of your program you aren't likely to see much improvement from assembly.  

Take it from me, I've written and I am maintaining a 500,000 line assembly program.  And I'm rewriting the whole thing in C++.
0
 
LVL 5

Author Comment

by:icd
ID: 1171069
I recognise that C is more maintainable/efficient/etc that hand coded assembler. I am however writing a security product and need to get down to assembler to make it more difficult to reverse engineer. (an impossible task I know!).

OK. Is MASM V6.11 still available from Microsoft?
0
 
LVL 4

Expert Comment

by:agreen
ID: 1171070
MASM 6.11 comes with the DDK package.
0
 
LVL 2

Expert Comment

by:warmcat
ID: 1171071
The DDK package comes with MSDN (http://msdn.microsoft.com/developer/) and is worth the money
0
 
LVL 22

Expert Comment

by:nietod
ID: 1171072
You can but MASM 6.11 seperately too.  I assume that is cheaper.

Note however that (despite thier claims) Microsoft no longer supports masm.  The technical support is through the C++ people.  My last 2 calls resulted in long discussions where I had to teach them enough to understand the question.  No one was able to resolve the problems.  There has not been an upgrade in about 5 years.  I'm an alpha tester and have not been contacted about future testing.  The masm team members I know of all seem to be working elsewhere.  
0
 
LVL 5

Author Comment

by:icd
ID: 1171073
Thanks everyone, all gave good answers, sorry I can't share the points.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
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 learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

721 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