• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 374
  • Last Modified:

Compiling .asm file as part of the Visual C++ Project


How can I make Visual C++ IDE/compiler to compile .asm file which is part of the Visual C++ project? What other tools do I need to compile the .asm file? Or, will the VC++ compiler itself compile .asm file, with any switch?

Also, how can I change the code segment for a particular function? Is there any way I can specify a different code segment for a particular function?

please help me.

Thanx in advance,
Jayaraj J.
  • 2
1 Solution
Q106399 - INFO: Using the Development Studio or Visual Workbench with MASM  


You can select a particular segment by using

#pragma code_seg

or setting options in the compiler for that module or by using the normal MASM segment-setting pseudo ops.

However, these days, very few persons use asm, and when it is needed, you can usually write the necessary code using __asm blocks right inside of a C++ function.

-- Dan
Hi Jayaraj_J,

As an expert here at EE, I am striving for a "4.0 grade point average."  When you accept my comment as a "Good" answer, it lowers my average.  Please answer these questions, to help me understand how to improve:

1) Did the comment I posted help you to solve your problem?

2) Obviously my comment was less than a perfect solution in your eyes.  What could I have added to make it 100% perfect?

3) Do you understand that if the comment does not fully solve your problem, that you have the option -- in fact, the responsibility -- to respond to clarify the question or add some details?

4) Do you understand that it costs you no more to give an A than it does to give a B or a C, but that the expert recieves more points for the better grade?

5) Have you read the information at
and do you understand it?

6) Is there anything I said that offended you in any way?

-- Dan
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.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now