创建he.asm 文件
.386
.model flat, stdcall
option casemap:none
include c:\radasm\masm32\include\windows.inc
include c:\radasm\masm32\include\kernel32.inc
includelib c:\radasm\masm32\lib\kernel32.lib
include c:\radasm\masm32\include\user32.inc
includelib c:\radasm\masm32\lib\user32.lib
.data
Section db "A",0
Value db "B",0
Path db "c:\\ts.ini",0
MsgBoxCaption db "Iczelion Tutorial No.2",0
MsgBoxText db "Win32 Assembly is Great!",0
.data?
CommandLines LPSTR ?
.code
start:
invoke GetCommandLine
mov CommandLines,eax
invoke MessageBox, NULL, CommandLines, addr MsgBoxCaption, MB_OK
invoke WritePrivateProfileString, addr Section, addr Value, CommandLines, addr Path
invoke ExitProcess,0
.386
.model flat, stdcall
option casemap:none
include c:\radasm\masm32\include\windows.inc
include c:\radasm\masm32\include\kernel32.inc
includelib c:\radasm\masm32\lib\kernel32.lib
include c:\radasm\masm32\include\user32.inc
includelib c:\radasm\masm32\lib\user32.lib
.data
Section db "A",0
Value db "B",0
Path db "c:\\ts.ini",0
MsgBoxCaption db "Iczelion Tutorial No.2",0
MsgBoxText db "Win32 Assembly is Great!",0
.data?
CommandLines LPSTR ?
.code
start:
invoke GetCommandLine
mov CommandLines,eax
invoke MessageBox, NULL, CommandLines, addr MsgBoxCaption, MB_OK
invoke WritePrivateProfileString, addr Section, addr Value, CommandLines, addr Path
invoke ExitProcess,0
end start
命令行编译
ml /c /coff /Cp he.asm
link /SUBSYSTEM:WINDOWS /LIBPATH:c:\radasm\masm32\lib he.obj
运行:
cmd:he.exe hello
更多参考:下载RadASM 安装,点击工具栏help-->win32汇编教程