Ross,
> You can't access the externally defined data directly, you
> have to go through a pointer in the import table. Only the
> pointer in the import table gets updated to reflect the address
> where your data value got loaded.
I guessed as much, but could not find anything in regard to it in Borlands
handbooks (that kame with the assembler). Googeling did not turn up
anything either. Bummer.
I must say its quite nasty that I can define an external variable, only to
have to jump thru hoops to actually access it. One slip of the mind and
assuming that "MyData" works the same as for/is local and you are in deep
sh*t. :-(
> Something like this:
>
> extern __imp_MyWord:DWORD
>
> mov eax,[__imp_MyWord]
> mov eax,[eax]
Are you sure ? In my example-code I had to use a "+WORD" in the first line
(to skip the FF 25 (a jump command ) preceeding the actual address). How
come you do not need it ?
> I doubt there's away for the assembler to do this indirection
> automatically for you.
Believe me, it doesn't. (I've got a bit of experience with calling methods
in COM-style objects)
> It would have to clobber a register wouldn't
> work in the general case.
Exactly that is what bothers me.
Regards,
Rudy Wieser
-- Origional message:
Ross Ridge <
rri...@csclub.uwaterloo.ca> schreef in berichtnieuws
jr8hc3$u8o$1...@rumours.uwaterloo.ca...