Dereference pointer in inline assembly

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Could anyone please tell me if there is a syntax to dereference a pointer in
inline assembly? Something like:

int *a = ...;
__asm mov eax, *a; // move dword from location pointed to by a

I could do:

__asm mov edx, a;
__asm mov eax, [edx];

but it would help me if I could do it in one step.

Thank you.
 
Euphilos said:
Could anyone please tell me if there is a syntax to dereference a pointer in
inline assembly? Something like:

int *a = ...;
__asm mov eax, *a; // move dword from location pointed to by a

I could do:

__asm mov edx, a;
__asm mov eax, [edx];

but it would help me if I could do it in one step.

No, because the x86 instruction set does not have such operation.
When you use inline asm, you use the native cpu instructions.

--PA
 
Euphilos said:
Could anyone please tell me if there is a syntax to dereference a pointer
in
inline assembly? Something like:

int *a = ...;
__asm mov eax, *a; // move dword from location pointed to by a

I could do:

__asm mov edx, a;
__asm mov eax, [edx];

Just for grins, what does __asm mov eax, [a]; do?
 
Back
Top