Link to home
Start Free TrialLog in
Avatar of hengck23
hengck23

asked on

MSVC inline assembler equivalent of address operator "&"?

Dear all,

Why can i get the address of local variables in inline assembler in MSVC?

void func(
  int* a,
  int b
){
   int c;
   int* d;

  __asm mov eax, addressOf b ?
  (in C code , it would be: eax=&c)

}

thank you.
SOLUTION
Avatar of dimitry
dimitry

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hengck23
hengck23

ASKER

I tried the keyword OFFSET, but it doesn't work.
I think "OFFSET" only works in the main function.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi,

I know about  "param-N          [ebp + 4+N*4]". I was just wondering is there a MARCO expression for this in MSVC inline assember.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I am looking for a MACRO expression. But I guess there is none. I would have to use "lea (to get address)" or ,"mov ... [EBP+ ... ] (to get value)" then.