|
发表于 2013-1-26 04:26:34
|
显示全部楼层
本帖最后由 メ㊣逆ご帅☆ 于 2013-1-26 16:16 编辑
好几行的invoke 打成inovke
我直接用编辑器的功能把所有inovke替换成invoke
好了,第一个错误解决
下一个错误
56行
不是DefWindowproc
而是DefWindowProc
大小写下次注意点哦。
接下来75行
invoke打成innovke。。
改掉
接下来
25行
szText db 'Win32 Assembly, Simple and powerful !'0
少了个逗号
改成
szText db 'Win32 Assembly, Simple and powerful !',0
好了搞定
以下是编译提示(可以无视):
Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.
C:\Documents and Settings\Administrator>d:
D:\>cd masm32
D:\masm32>var.bat
D:\masm32>cd ns
D:\masm32\NS>cd alltest
D:\masm32\NS\alltest>nmake
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
ml /c /coff smc.asm
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997. All rights reserved.
Assembling: smc.asm
smc.asm(40) : error A2008: syntax error : inovke
smc.asm(44) : error A2008: syntax error : inovke
smc.asm(45) : error A2008: syntax error : DrawTextA
smc.asm(49) : error A2008: syntax error : inovke
smc.asm(52) : error A2008: syntax error : inovke
smc.asm(53) : error A2008: syntax error : inovke
smc.asm(56) : error A2008: syntax error : inovke
smc.asm(69) : error A2008: syntax error : inovke
smc.asm(71) : error A2008: syntax error : RtlZeroMemory
smc.asm(75) : error A2008: syntax error : innovke
smc.asm(84) : error A2008: syntax error : inovke
smc.asm(88) : error A2008: syntax error : CreateWindowExA
smc.asm(94) : error A2008: syntax error : inovke
smc.asm(95) : error A2008: syntax error : inovke
smc.asm(100) : error A2008: syntax error : inovke
smc.asm(102) : error A2008: syntax error : inovke
smc.asm(103) : error A2008: syntax error : inovke
smc.asm(110) : error A2008: syntax error : inovke
smc.asm(25) : error A2206: missing operator in expression
NMAKE : fatal error U1077: 'ml' : return code '0x1'
Stop.
D:\masm32\NS\alltest>nmake
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
ml /c /coff smc.asm
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997. All rights reserved.
Assembling: smc.asm
smc.asm(56) : error A2006: undefined symbol : DefWindowproc
smc.asm(75) : error A2008: syntax error : innovke
smc.asm(25) : error A2206: missing operator in expression
NMAKE : fatal error U1077: 'ml' : return code '0x1'
Stop.
D:\masm32\NS\alltest>nmake
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
ml /c /coff smc.asm
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997. All rights reserved.
Assembling: smc.asm
smc.asm(56) : error A2006: undefined symbol : DefWindowproc
smc.asm(75) : error A2008: syntax error : innovke
smc.asm(25) : error A2206: missing operator in expression
NMAKE : fatal error U1077: 'ml' : return code '0x1'
Stop.
D:\masm32\NS\alltest>nmake
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
ml /c /coff smc.asm
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997. All rights reserved.
Assembling: smc.asm
smc.asm(75) : error A2008: syntax error : innovke
smc.asm(25) : error A2206: missing operator in expression
NMAKE : fatal error U1077: 'ml' : return code '0x1'
Stop.
D:\masm32\NS\alltest>nmake
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
ml /c /coff smc.asm
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997. All rights reserved.
Assembling: smc.asm
smc.asm(25) : error A2206: missing operator in expression
NMAKE : fatal error U1077: 'ml' : return code '0x1'
Stop.
D:\masm32\NS\alltest>nmake
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
ml /c /coff smc.asm
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997. All rights reserved.
Assembling: smc.asm
Link /subsystem:windows /section:.text,RWE smc.obj
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
细节问题。
下次看编译错误提示,一般都是简单的英语
看不懂百度翻译下,下次你就懂了。
如果不想直接看视频中的代码也可以找到错误的,
下次细心。
最后是完整修改后代码
.386
.model flat,stdcall
option casemap:none
;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; Include 文件定义
;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
include windows.inc
include gdi32.inc
includelib gdi32.lib
include user32.inc
includelib user32.lib
include kernel32.inc
includelib kernel32.lib
;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
;数据段
;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
.data?
hInstance dd ?
hWinMain dd ?
.const
szClassName db 'MyClass',0
szCaptionMain db 'My first Window!',0
szText db 'Win32 Assembly, Simple and powerful !',0
;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; 代码段
;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
.code
;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
;窗口过程
;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
_ProcWinMain proc uses ebx edi esi,hWnd,uMsg,wParam,lParam
local @stPs:PAINTSTRUCT
local @stRect:RECT
local @hDc
mov eax,uMsg
;**************************************************************************
.if eax == WM_PAINT
invoke BeginPaint,hWnd,addr @stPs
mov @hDc,eax
invoke GetClientRect,hWnd,addr @stRect
invoke DrawText,@hDc,addr szText,-1,\
addr @stRect,\
DT_SINGLELINE or DT_CENTER or DT_VCENTER
invoke EndPaint,hWnd,addr @stPs
;****************************************************************************
.elseif eax == WM_CLOSE
invoke DestroyWindow,hWinMain
invoke PostQuitMessage,NULL
;****************************************************************************
.else
invoke DefWindowProc,hWnd,uMsg,wParam,lParam
ret
.endif
;****************************************************************************
xor eax,eax
ret
_ProcWinMain endp
;*****************************************************************************
_WinMain proc
local @stWndClass:WNDCLASSEX
local @stMsg:MSG
invoke GetModuleHandle,NULL
mov hInstance,eax
invoke RtlZeroMemory,addr @stWndClass,sizeof @stWndClass
;******************************************************************************
;注册窗口类
;******************************************************************************
invoke LoadCursor,0,IDC_ARROW
mov @stWndClass.hCursor,eax
push hInstance
pop @stWndClass.hInstance
mov @stWndClass.cbSize,sizeof WNDCLASSEX
mov @stWndClass.style,CS_HREDRAW or CS_VREDRAW
mov @stWndClass.lpfnWndProc,offset _ProcWinMain
mov @stWndClass.hbrBackground,COLOR_WINDOW + 1
mov @stWndClass.lpszClassName,offset szClassName
invoke RegisterClassEx,addr @stWndClass
;*******************************************************************************
;建立并显示窗口
;*******************************************************************************
invoke CreateWindowEx,WS_EX_CLIENTEDGE,\
offset szClassName,offset szCaptionMain,\
WS_OVERLAPPEDWINDOW,\
100,100,600,400,\
NULL,NULL,hInstance,NULL
mov hWinMain,eax
invoke ShowWindow,hWinMain,SW_SHOWNORMAL
invoke UpdateWindow,hWinMain
;*********************************************************************************
;消息循环
;*********************************************************************************
.while TRUE
invoke GetMessage,addr @stMsg,NULL,0,0
.break .if eax == 0
invoke TranslateMessage,addr @stMsg
invoke DispatchMessage,addr @stMsg
.endw
ret
_WinMain endp
;*********************************************************************************
start:
call _WinMain
invoke ExitProcess,NULL
;*********************************************************************************
end start
最后下次代码还是用回复功能的添加代码功能来放代码比较好
不然 :反和谐P 和fishc论坛的表情有冲突的。
|
评分
-
查看全部评分
|