MASM32配环境自用
下载并安装masm32http://www.masm32.com/
配置三个地方1:
2:链接器加lib路径
3:Microsoft Macro Assembler中添加include路径
碰到的问题1:找不到Microsoft Macro Assembler
右击asm文件选择属性
2:无法编译成功:
安装旧版本的MSVC,然后使用旧版本编译
;测试代码
.586
.model flat,stdcall;cong you dao zuo
option casemap:none
include windows.inc
include user32.inc
include kernel32.inc
includelib user32.lib
includelib kernel32.lib
include msvcrt.inc
includelib msvcrt.lib
.data
text db "hello world!",0
textsize = ($-text)-1
;format db "%s",0
format db "%s",0
num dword 5
.code
main proc
;INVOKE MessageBox,0,offset text, offset text,0
;push 0
;push offset text
;push offset text
;push 0
;call MessageBox
;push offset text2
;push offset format
;call crt_scanf
;add esp,8
;push offset text2
;call crt_printf
mov ecx,textsize
mov esi,0
lp:
movzx eax,text[esi]
push eax
inc esi
loop lp
mov ecx,textsize
xor esi,esi
l1:
pop eax
mov text[esi],al
inc esi
loop l1
push offset text
call crt_printf
add esp,4
push 0
call ExitProcess
add esp,4
;INVOKE ExitProcess,0
main endp
end main
,