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

x
?
Solved

Linking Assembler Module

Posted on 2006-04-28
3
Medium Priority
?
210 Views
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.
0
Comment
Question by:reidy_boy
  • 2
3 Comments
 
LVL 22

Assisted Solution

by:mahesh1402
mahesh1402 earned 80 total points
ID: 16561419
Refer this :

http://www.codeproject.com/dotnet/VCNetAssemberCode.asp

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.

e.g.

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:
$(InputName).obj


MAHESH
0
 
LVL 22

Expert Comment

by:mahesh1402
ID: 16561470
Also refer this to compile and link ASM file :
http://www.geocities.com/thestarman3/asm/masm.htm

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

MAHESH
0
 
LVL 45

Accepted Solution

by:
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
0

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