assemblynotepad++masmdosboxnppexec

8086 masm, how to skip entering object filename, source listing, etc and to directly execute asm file in DOSBox using Notepad++


I am using DOSBox to run masm.exe.

When every time I compile and link my source file and object file, it is very annoying to keep pressing "Enter" key just to skip entering object filename, source listing, cross-reference, etc.

My friend once taught me how to skip these but I forgot after one semester and when I ask him, he also forgot too.

I am working on my assignment so if I can skip this, I can avoid wasting time to press hundred times of "Enter" key.

Any help is appreciated.

enter image description here


Solution

  • I found the solution, thanks to @Jester.

    Just add 4 commas behind your file name.

    Just add a semicolon behind your file name ~ @Ross Ridge

    For example, you need to compile foo.asm and link foo.obj:

    *File extension can skip.

    masm foo;
    

    Same for linking

    link foo;
    

    Usage:

    So you can directly execute your asm file through Notepad++ using NppExec

    "<insert your DOSBox directory>" -c "mount <insert drive that contain 8086 folder> <insert 8086 folder directory>" -c "<insert drive that contain 8086 folder>:" -c "masm $(NAME_PART);" -c "link $(NAME_PART);" -c "$(NAME_PART)"
    

    For my script is:

    "D:\Program Files (x86)\DOSBox-0.74\DOSBox.exe" -c "mount d d:\8086" -c "d:" -c "masm $(NAME_PART);" -c "link $(NAME_PART);" -c "$(NAME_PART)"
    

    This script helps you execute your .asm file only with one key press instead of 30+ key presses (yes, I counted).


    The following steps is for people don't know how to use Notepad++ or NppExec:

    1. Install Notepad++
    2. Install Plugin Manager
    3. Install NppExec using Plugin Manager
    4. Press F6
    5. Paste the script
    6. Press save and give a name
    7. Go to Plugins > NppExec > Advanced Option
    8. Select the script you save in Associated script > Add/Modify > Close
    9. Go to Macro > Modify Shortcut/Delete Shortcut > Select Plugin commands tab > Set a shortcut for your script

    *Remember to put your .asm file in the same directory with your masm.exe

    Done! Hope I minimize your misery.