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
Posted on 2005-01-07 23:15:57 by Retsim_X
Use the address. Where you are trying to move 101 into the 68th DWORD in the array ...

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
Posted on 2005-01-07 23:21:50 by donkey
In MASM you must use OFFSET for data in the .DATA section.

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.
Posted on 2005-01-08 00:51:50 by hutch--
thanks guys thats really handy :-D
Posted on 2005-01-08 21:26:50 by Retsim_X