I was trying to work out how to refer to the location of the label/variable (pointer?), the number of bytes used by the label/variable, and the actual value stored in the label/variable.
eg.
Addr hWnd = pointer to where hWnd is stored, or is it the number of bytes used by hWnd?
[hwnd] = ?
mov eax,addr hWnd ; Pointer to hWnd.
mov eax,[hWnd] ; Value (DWORD) stored in hWnd.
mov eax,sizeof hWnd ; Number of bytes in hWnd.
Hi Yuri, thanks for your fast reply. One thing, what does the + 2 do in this code?
Add Eax, Addr String + 2
mov eax,sizeof hWnd ; Number of bytes in hWnd.
careful with that, it gives you the sizeof of the data type, so for instance that'd be 4 bytes if you did globalloc 100000 bytes, the return handle would still be 4 bytes with sizeof.
Quote from: NewEasycoder on July 08, 2010, 09:12:42 AM
One thing, what does the + 2 do in this code?
Add Eax, Addr String + 2
It adds 2 to the address of String.
Quote from: Yuri on July 08, 2010, 10:41:56 AM
Quote from: NewEasycoder on July 08, 2010, 09:12:42 AM
One thing, what does the + 2 do in this code?
Add Eax, Addr String + 2
It adds 2 to the address of String.
Hi again Yuri, GoAsm.chm doesn't want to run on my machine for some reason, even though EasyCode.chm does, so rather than asking lots of questions, is there any resource that I can use that describes the GoASM operators such as Add, Mov, etc?
http://www.goprog.com/GoDevTool/GoasmFrame.htm
Hi NewEasycoder,
Right click on the GoAsm.chm, choose 'Properties', click on the 'Unlock' button and then 'OK'.
Ramon