Can some one tell me why i cannot use here in mov command. This look me to litle bit wierd becose wID and nID are
are same sizes.
are same sizes.
.386
.model flat, stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
Main PROTO
.data?
nID DWORD ?
.code
start:
invoke Main
invoke ExitProcess,eax
Main proc
LOCAL mii:MENUITEMINFO
mov mii.wID, nID
Main endp
end start
you can't do memory to memory copies in asm. You must do
mov , nID
mov mii.wID,
so if the eax register is free,
mov eax, nID
mov mii.wID, eax
will work. Or if you don't have any free registers to use then you can push & pop the values:
push nID
pop mii.wID
mov , nID
mov mii.wID,
so if the eax register is free,
mov eax, nID
mov mii.wID, eax
will work. Or if you don't have any free registers to use then you can push & pop the values:
push nID
pop mii.wID
Or you can use a cool MACRO that i've seen in hutch?s and Iczelion's:
m2m MACRO
push whateve
pop whatever
ENDM
(Well, it?s not exactly that, but you know what I mean ;) Check it)
m2m MACRO
push whateve
pop whatever
ENDM
(Well, it?s not exactly that, but you know what I mean ;) Check it)