
by chenjx 2015/5/16
鉴于网上流传的教程总是会存在某些瑕疵,决定把自己的配置过程写出来与大家分享。
先把基础概念放在前面
1. notepad++ 的默认工作目录为 notepad++ 所在目录,故一切输出默认皆在此。
故要改变当前的工作目录,必须先使用 “cd 目标目录” 命令进行切换。
2. windows 命令行中,如果要使用 \\ 符号,必须使用两道 \\\\。
3. 为防止路径中出现空格而导致出错,使用双引号("my_path")来包含路径,对于环境变量也如此。
4. 如果想直接执行某一个命令而不想输入其路径,则必须先把其所在目录放置到环境变量 path 中。
5. 使用 “command /?” 来获得命令的帮助。
原材料
win7 32位,notepad++,masm615(本人从老站下载的masm,版本v6.15)
步骤
把 masm615 包解压缩到 c:\\Program Files 下
环境变量 path 下添加路径:c:\\Program Files\\masm615
计算机 | 属性 | 高级系统设置 | 环境变量 | 系统变量(用户变量也行)
在 notepad++ 中,按 F5 打开运行对话框
输入命令:cmd /k cd /D "$(CURRENT_DIRECTORY)" & ml /c "$(FULL_CURRENT_PATH)" & pause & exit
点击保存,并输入名称和快捷键
命名:assembly .asm
快捷键:ctrl-alt-,(英文的逗号)
输入命令:cmd /k cd /D "$(CURRENT_DIRECTORY)" & ml "$(NAME_PART)".obj & pause & exit
点击保存,并输入名称和快捷键
命名:link .obj
快捷键:ctrl-alt-.(英文的句点)
输入命令:cmd /k cd /D "$(CURRENT_DIRECTORY)" & $(NAME_PART).exe & pause & exit
点击保存,并输入名称和快捷键
命名:execute .exe
快捷键:ctrl-alt-/(斜杠)
输入命令:cmd /k cd /D "$(CURRENT_DIRECTORY)" & debug $(NAME_PART).exe & pause & exit
点击保存,并输入名称和快捷键
命名:debug .exe
快捷键:ctrl-alt-;(英文分号)
其他 IDE 配置也同理。
附:notepad++ 参考原文
To run a new command:
Sselect Run->Run.... A dialog will pop up asking for the path to the program and possible any command line parameters. You can use the browse button to search for your program. The drop down list provides recently run programs. The command line arguments can also be based on the status of the current document, and are always enclosed in $(...), where … can be:
FULL_CURRENT_PATH
the fully qualified path to the current document.
CURRENT_DIRECTORY
The directory the current document resides in.
FILE_NAME
The filename of the document, without the directory.
NAME_PART
The filename without the extension.
EXT_PART
The extension of the current document.
NPP_DIRECTORY
The directory that contains the notepad++.exe executable that is currently running.
>CURRENT_WORD
The currently selected text in the document.
CURRENT_LINEThe current line number that is selected in the document (0 based index, the first line is 0).
CURRENT_COLUMN
The current column the cursor resides in (0 based index, the first position on the line is 0).
For example,
"$(NPP_DIRECTORY)\\notepad++.exe" -multiInst "$(FULL_CURRENT_PATH)"
would start a new instance of Notepad++ opening the current file. Remember to put quotes around paths if it can contain spaces. For the Notepad++ command line options, see Command Line.
-- Enjoy it --
