The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Parse on December 29, 2004, 02:29:01 PM

Title: call 234?
Post by: Parse on December 29, 2004, 02:29:01 PM
hm.. I was just wondering if you do something like


.data
api001 dd (address of an api)

.code
call api001


What does masm replace call api001 with, something like call [ds+0] ??
Title: Re: call 234?
Post by: pbrennick on December 29, 2004, 03:31:12 PM
Assemble it and tell us.
Title: Re: call 234?
Post by: Ghirai on December 29, 2004, 04:08:41 PM
Probably because api001 is the first in your data segment; [ds+0] points to api001.

If it was the n-th in your .data, you would have [ds+n*sizeof(whatever)].
Title: Re: call 234?
Post by: evlncrn8 on December 29, 2004, 07:09:47 PM
should be call dword ptr [api001] tho otherwise it'd probably crash ;)
Title: Re: call 234?
Post by: Vortex on December 29, 2004, 07:57:42 PM
Parse,

It's the job of the windows loader to locate the adresses of API functions.
Title: Re: call 234?
Post by: Parse on December 30, 2004, 02:41:28 PM
Ok, I figured out what I wanted to do was pretty useless so I found a different, better, way.