能力值:
( LV9,RANK:380 )
|
-
-
2 楼
反汇编后可以知道,其实
hInstance
@stWndClass.hInstance
都是指针,对指针的赋值,一般都用 push/pop(直接通过堆栈传递)
当然,你也可以这样写(这个是通过寄存器传递值):
lea eax,hInstance ;取出hInstance地址的内容存eax
mov @stWndClass.hInstance,eax ;保存到@stWndClass.hInstance 说白了,一个直接通过堆栈传递,另一个通过寄存器传递值
|
能力值:
( LV2,RANK:10 )
|
-
-
3 楼
如果是指针的话 那么我mov @stWndClass.hInstance,offset hInstance也是可以的吧
|
能力值:
( LV2,RANK:10 )
|
-
-
4 楼
invoke GetModuleHandle,NULL
mov hInstance,eax
难道说GetModuleHandle得到的不是句柄,而是句柄的指针吗?
|
能力值:
( LV2,RANK:10 )
|
-
-
5 楼
如果要用mov的话:
lea eax,hInstance
mov @stWndClass.hInstance,eax
你愿意用哪种?
|
能力值:
(RANK:410 )
|
-
-
6 楼
楼上两位都写错了。应该是这样用才对。
mov eax,hInstance
mov @stWndClass.hInstance,eax
|
能力值:
(RANK:410 )
|
-
-
7 楼
迟发了一步,十指紧扣兄已经回复了。
|
能力值:
( LV2,RANK:10 )
|
-
-
8 楼
能说说
mov eax,hInstance
mov @stWndClass.hInstance,eax
和
mov @stWndClass.hInstance,hInstance有什么区别?
mov @stWndClass.hInstance,hInstance ; mov指令不允许两个操作数都是内存,所以这一句是非法的指令,编译器是通不过编译的。所以只能先将内存的值取出来再放进另一个内存里,也就是下面的操作:
push hInstance
pop @stWndClass.hInstance
或
mov eax,hInstance
mov @stWndClass.hInstance,eax
才行。
上面两种方法都可以,至于用第一种还是第二种就看各人的爱好了。
|
能力值:
( LV9,RANK:380 )
|
-
-
9 楼
mov @stWndClass.hInstance,hInstance
这句用masmplus编译不过.......
|
能力值:
( LV2,RANK:10 )
|
-
-
10 楼
楼上的各位有说是lea eax,hInstance,有的说是mov eax,hInstance,请问哪个是正确的?
请顺便说说lea的功能? 我是新手
|
能力值:
(RANK:410 )
|
-
-
11 楼
mov eax,hInstance ; 这一句是将hInstance保存的程序实例句柄传给eax
lea eax,hInstance ; 这一句是将hInstance变量的偏移地址传给eax。
而你的程序是要实例句柄而不是要hInstance变量的地址。所以上面的操作这样才对。
mov eax,hInstance
mov @stWndClass.hInstance,eax
而不是:
lea eax,hInstance
mov @stWndClass.hInstance,eax
|
能力值:
(RANK:410 )
|
-
-
12 楼
晕,我引用lanshen你贴子却变成了编辑你的贴子了。
|
能力值:
( LV13,RANK:370 )
|
-
-
13 楼
mov @stWndClass.hInstance,hInstance是错误的!
mov指令中除源操作数是立即数外,必须有一操作数为寄存器操作数!
|
能力值:
( LV2,RANK:10 )
|
-
-
14 楼
3Q 谢谢各位
|
|
|