Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Linking Assembler Module

Posted on 2006-04-28
Medium Priority
Last Modified: 2013-11-20
Can anybody tell me how to link some assembler code into my MFC application?  I think I need to convert it into object code first, how do I do that?  Many thanks in advance.
Question by:reidy_boy
  • 2
LVL 22

Assisted Solution

mahesh1402 earned 80 total points
ID: 16561419
Refer this :


Other way :
You need to manually (for each assembler source file) add a file to your project, then alter the custom build project settings for that file.


In the commands section:
c:\masm611\bin\ml /nologo /c /coff $(InputName).asm

the /c tells masm to compile, but not link.
the /coff tells masm to output in COFF object format.

In the output section:

LVL 22

Expert Comment

ID: 16561470
Also refer this to compile and link ASM file :

http://www.jimweller.net/jim/vc98asmqs/vc98asmqs.pdf  <=======

LVL 45

Accepted Solution

AndyAinscow earned 320 total points
ID: 16561681
Also look at the _asm keyword in help.

... c code here
__asm {
   mov al, 2
   mov dx, 0xD007
   out dx, al
... and more c code

that compiles a small block of assembler inside a C/C++ function

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses
Course of the Month12 days, 2 hours left to enroll

564 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