Hi,
this is taken literally straight from the GoAsm manual. But I'm a little unsure as to what happens when data is imported.
EXPORT DATA_VALUE DD 10
What does the following actually place into the eax register? Is it the offset of the data within the exporting module, or the value 10?
MOV EBX,[DATA_VALUE] ;get pointer to DATA_VALUE
MOV EAX,[EBX] ;get the value
Thanks.
Stephen.
Hi Stephen,
The example you gave will put 10 into the EAX register. Data that is exported from a dynamic library (DLL/OCX etc...) is imported by address. That is that the label you use is actually a pointer to the data. In the example it would move the address into EBX then by dereferencing it, move the data at that address (in this case 10) into EAX. If you were doing the same thing with a label in your local data section it would look like this...
mov ebx, offset DATA_VALUE
mov eax, [ebx]
However when external data is involved [DATA_VALUE] will yeild the offset directly.
Donkey
Excellent, that is what I hoped was happening.
Thanks Donkey.
:8)