how to compile assembly

Posted on 2004-11-04
Last Modified: 2010-05-18

I have generated assembly listing in MSVC 6.0.
I have then optimized and changed the code.
How do I then generated the new obj and invoke the linker to make the new program?
Can it be done with MSVC?

THank you.
Question by:hengck23
    LVL 9

    Accepted Solution

    >>>How do I then generated the new obj and invoke the linker to make the new program?
    You can compile it with MASM6.x assembler first and then link it with your other modules.
    >>>Can it be done with MSVC?
    No, but you can convert your code into inline asm with _asm {... } directive, I think it's maybe the simplest approach for you.

    LVL 3

    Assisted Solution

    Keep your optimizations to the most crucial loops and such, where it'll actually make a noticable difference - coding in assembly instead of C tends to make your code less readable, so don't do it everywhere.

    Before you go for this approach, though, have you compiled in Release mode with optimizations on? Chances are the compiler knows what it's doing.
    LVL 2

    Assisted Solution


    The most popular assemblers on the net are:
    NASM (Netwide Assembler):
    MASM (The Microsoft Macro Assembler):
    TASM (Turbo Assembler): It isn't free. So contact Borland and pay them $$.

    I strongly recommend you go for the first one if you're not particular about getting an ancient, expensive compiler (ie. TASM). Don't even think about MASM.

    Hope this helps,

    LVL 61

    Expert Comment

    No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

    I will leave the following recommendation for this question in the Cleanup topic area:
        Accept: BeyondWu {http:#12500621} & Rosuav {http:#12889554} & ram_einstein {http:#13122540}

    Any objections should be posted here in the next 4 days. After that time, the question will be closed.

    EE Cleanup Volunteer

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Suggested Solutions

    Title # Comments Views Activity
    LNK2017 error with MASM64 2 1,533
    pthread_create() fails with rc 11 56 1,025
    Assembly Code 1 775
    Get register length/size? 5 585
    After several days of searching and hunting for limited documentation, I wanted to share this guide to hopefully save someone the hassle of trying to figure this out on their own. I have tested this on Xendesktop 7.1 and PS 4.5 running simultaneous…
    This post first appeared at Oracleinaction  ( Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    This video discusses moving either the default database or any database to a new volume.

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now