3

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

wei
  • 937
  • 2
  • 14
  • 34
  • Have you tried `masm /help`? – Jester Jun 14 '18 at 11:44
  • @Jester I tired but I didn't find option to hide or suppress them. – wei Jun 14 '18 at 11:50
  • 1
    Then your masm must be different from mine which says: `masm /options source(.asm),[out(.obj)],[list(.lst)],[cref(.crf)][;]` meaning you can list the files on the command line and then it won't ask. – Jester Jun 14 '18 at 11:56

1 Answers1

6

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.

wei
  • 937
  • 2
  • 14
  • 34
  • 1
    On Linux (building native executables with NASM + `ld`), I typically use a script to assemble+link, then on the same line actually run the program if it assembled ok. (`asm-link foo.asm && ./foo`). So my workflow is: 1) save in emacs, 2) alt+tab 3) up-arrow + return. – Peter Cordes Jun 14 '18 at 22:25