搭建UltraEdit Win32ASM实验环境

1、下载我下载的是这个版本:“UltraEdit 13.00a+2 净化绿色 免注册版”(http://www.onegreen.net/Soft_Show.asp?SoftID=3453)

2、设置(1)语法着色:在UltraEdit的安装目录下有个wordfile.txt文件,它就是语法着色的配置文件。UltraEdit默认是不对masm语法着色的,要让其支持得先下载一个支持着色的文件:http://www.ultraedit.com/files/wf/masm.txt,下载好后我们把它追加到原来的wordfile.txt尾部。这里有个地方可能要改一下,就是刚开始的“/L20”,L应该是Language意思,20指第几种(上两句是我猜的),UltraEdit一次只支持20种语法着色。所以如果你的UltraEdit以没动过的话,默认也行。如果想紧凑点,就改成“/Lxx”(xx紧接上一个“/Lxx-1”),总之只要不重复就行了。(2)为“用户工具”配置脚本:新建一个批处理文件,命名为“Go.bat”,内容如下(lib 、include、path路径请根据你的实际情况修改):

[csharp] view plain copy print ?
  1. @echo off


  2. rem Simply Complie, Build and Execute Win32ASM programs.


  3. rem Author: t0nsha<liaodunxia{at}gmail.com>, Update@20080526


  4. set filename="%~n1"


  5. if not exist %filename%.asm (


  6. echo Error! The asm source file: "%filename:"=%.asm" does not exist!


  7. echo Usage: %~n0 filename[.asm]


  8. pause


  9. goto :eof


  10. )


  11. if not exist "D:/masm32/bin/ML.exe" (


  12. echo Error! Can't find "D:/masm32/bin/ML.exe" !


  13. echo Please confirm you've already installed masm32v9r at the root of the d:/


  14. pause


  15. goto :eof


  16. )


  17. set include=D:/masm32/include;%include%


  18. set lib=D:/masm32/lib;%lib%


  19. set path=D:/masm32/bin;%PATH%


  20. set mlOption=/c /coff /Cp /Zi /nologo


  21. set linkOption=/SUBSYSTEM:WINDOWS /DEBUG /DEBUGTYPE:CV /NOLOGO


  22. set linkfile=%filename%.obj




  23. call :Clean %filename% exe pdb


  24. ml %mlOption% %filename%.asm


  25. if exist %filename%.rc (


  26. rc %filename%.rc


  27. set linkfile=%linkfile% %filename%.res


  28. )


  29. rem To share ".data?" section, please add: /section:.bss,S


  30. if exist %filename%.def set linkOption=%linkOption% /DLL /DEF:%filename%.def


  31. link %linkOption% %linkfile%


  32. rem Ext INFO: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q132340


  33. call :Clean %filename% obj res ilk exp


  34. if exist %filename%.exe start /b cmd /c %filename%.exe


  35. echo on & goto :eof




  36. :Clean


  37. if"%2"==""goto :CleanEnd


  38. if exist %filename%.%2 del %filename%.%2


  39. shift


  40. goto Clean


  41. :CleanEnd

@echo off

rem Simply Complie, Build and Execute Win32ASM programs.

rem Author: t0nsha<liaodunxia{at}gmail.com>, Update@20080526

set filename="%~n1"

if not exist %filename%.asm (

	echo Error! The asm source file: "%filename:"=%.asm" does not exist!

	echo Usage: %~n0 filename[.asm]

	pause

	goto :eof

)

if not exist "D:/masm32/bin/ML.exe" (

	echo Error! Can't find "D:/masm32/bin/ML.exe" !

	echo Please confirm you've already installed masm32v9r at the root of the d:/

	pause

	goto :eof

)

set include=D:/masm32/include;%include%

set lib=D:/masm32/lib;%lib%

set path=D:/masm32/bin;%PATH%

set mlOption=/c /coff /Cp /Zi /nologo

set linkOption=/SUBSYSTEM:WINDOWS /DEBUG /DEBUGTYPE:CV /NOLOGO

set linkfile=%filename%.obj



call :Clean %filename% exe pdb

ml %mlOption% %filename%.asm

if exist %filename%.rc (

	rc %filename%.rc

	set linkfile=%linkfile% %filename%.res

)

rem To share ".data?" section, please add: /section:.bss,S

if exist %filename%.def set linkOption=%linkOption% /DLL /DEF:%filename%.def

link %linkOption% %linkfile%

rem Ext INFO: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q132340

call :Clean %filename% obj res ilk exp

if exist %filename%.exe start /b cmd /c %filename%.exe

echo on & goto :eof



:Clean

if "%2"=="" goto :CleanEnd

if exist %filename%.%2 del %filename%.%2

shift

goto Clean

:CleanEnd

(3)配制“用户工具”:依次选择菜单“高级(A)”-》“工具配制(O)...”,打开“工具配制”窗口,点“插入”,然后选“命令”标签,在“菜单项名称(M):”填入“&Go”;在“命令行(L):”后填入“D:/masm32/Nmake_Make/Go.bat "%n"”(Go.bat路请按自己的设置,后面的那个%n的n最好为小写的n,如果是大写的N,则会将长文件名转化成DOS 的8.3格式的文件名);最后在“工作目录(W):”中填入“%P”,代表当前路径。(4)添加到“工具栏”:依次选择菜单“高级(A)”-》“配制(C)...”,打开“配制”对话框,展开“工具栏与菜单”,点“定制工具栏”按钮,在“工具栏配制”窗口的右列表框中找到“用户工具1”,选中,点那个向右的小三角,确定,我们刚定义的“用户工具1”即被添加到了工具栏。(5)定义快捷键(F5):在第4步打开“配制”对话框,找到“键映射”,找到“用户工具1”,在“按下新(多个)键:”下面的文本中按下“F5”键,点“分配”,以后我们写完程序后就可以像VC++中样按“F5”来运行了。

3、验收这里给出一个Win32ASM小程序,赶快来检查一下成果吧!

[csharp] view plain copy print ?
  1. .386


  2. .model flat,stdcall


  3. option casemap:none


  4. ;include


  5. include windows.inc


  6. include user32.inc


  7. includelib user32.lib


  8. include kernel32.inc


  9. includelib kernel32.lib


  10. ;data


  11. .data


  12. szCaption db '恭喜',0


  13. szText db '当您看到这个信息的时候,您已经可以编译WIN32汇编程序了!',0


  14. ;code


  15. .code


  16. start:


  17. invoke MessageBox,NULL,offset szText,offset szCaption,MB_OK


  18. invoke ExitProcess,NULL


  19. end start


你可能感兴趣的:(Win32ASM实验环境,搭建UltraEdit)