how do u move data into say myitem dd 1024 DUP (0)?
is it somtjin like
mov eax, 68
mov ebx,mydata
mov +eax,ebx
plz help
is it somtjin like
mov eax, 68
mov ebx,mydata
mov +eax,ebx
plz help
Use the address. Where you are trying to move 101 into the 68th DWORD in the array ...
However, since mydata is DWORD sized, you will not get the 68th element of the array. 68 is in bytes so you would get the 68/4 or 17th. You can do it automatically by multiplying though...
For LOCAL arrays, you must use LEA and have it calculate the address, everything else proceeds as normal
mov eax, 68
mov ebx,addr mydata
mov [ebx+eax], 101
However, since mydata is DWORD sized, you will not get the 68th element of the array. 68 is in bytes so you would get the 68/4 or 17th. You can do it automatically by multiplying though...
mov eax, 68
mov ebx,addr mydata
mov [ebx+eax*4],101
For LOCAL arrays, you must use LEA and have it calculate the address, everything else proceeds as normal
lea ebx,mydata
In MASM you must use OFFSET for data in the .DATA section.
To actually move the data from one location to another, you need a memory copy procedure that takes the address of the source and the address of the target and a count of bytes.
You can find these procedures in the MASM32 library.
mov edx, OFFSET variable
To actually move the data from one location to another, you need a memory copy procedure that takes the address of the source and the address of the target and a count of bytes.
You can find these procedures in the MASM32 library.
thanks guys thats really handy :-D