为什么是undefined symbol:lparam
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.386
.model flat,stdcall
option casemap:none
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;Indicate the instruction set
;on the right in
;Case sensitive
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;Include
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
include windows.inc
include gdi32.inc
includelibgdi32.lib
include user32.inc
includelibuser32.lib
include kernel32.inc
includelibkernel32.lib
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;data segment
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.data?
hInstance dd ?
hWinMain dd ?
szBuffer db 512 dup(?)
.const
szClassName db 'just begin',0
szCaptionMain db 'Receive Message',0
szReceive db 'Receive WM_COPYDATA message',0dh,0ah
db 'length: %08x',0dh,0ah
db 'text address: %08x',0dh,0ah
db 'text: "%s"',0dh,0ah,0
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;data segment
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.code
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;process
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
_Process proc uses ebx edi esi hWnd,uMsg,wParam,lParam
mov eax,uMsg
;*******************************************************************
;*******************************************************************
.if eax == WM_CLOSE
invokeDestroyWindow,hWinMain
invokePostQuitMessage,NULL
;*******************************************************************
.elseif eax == WM_COPYDATA
mov eax,lparam
assume eax:ptr COPYDATASTRUCT
invoke wsprintf,addr szBuffer,addr szReceive,\
.cbData,.lpData,.lpData
invoke MessageBox,hWnd,offset szBuffer,addr szCaptionMain,MB_OK
assume eax:nothing
.else
invokeDefWindowProc,hWnd,uMsg,wParam,lParam
ret
.endif
;*******************************************************************
xor eax,eax
ret
_Process 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 _Process
mov @stWndClass.hbrBackground,COLOR_WINDOW+1
mov @stWndClass.lpszClassName,offset szClassName
invoke RegisterClassEx,addr @stWndClass
;***************************************************************
;create window
;***************************************************************
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
;***************************************************************
;message loop
;***************************************************************
.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
提示的是 57行出错,出错的是lparam,,粗看了一下,是你打错了大小写 正确的是lParam,大写P
其实应该标记下出错位置,一般人看到没注释的全代码,都懒得细看的。。。 楼主不会是用记事本写的吧。。初学汇编,建议还是用RadASM,因为刚学,很容易写错代码,刚学本来就迷茫,编译连接出错有时半天找不出哪里错了,用有语法高亮,出错定位的开发环境,可以减少这类问题
页:
[1]