__asm Error C2443 (operand size conflict)

G

Guest

Hi

I'd like to get the stackpointer value in my C program
I tried this, but I keep getting a compiler error
What am I doing wrong

monitorStackPointer(

long value
__asm { mov value, SP
printf("%0x\n", value)


Thanks, Keith
 
R

Rainer Maurer [MS]

Hello,

stack pointer is esp
__asm { mov value, esp } should work.

Hope this helps,
Rainer
 
D

David Lowndes

I'd like to get the stackpointer value in my C program.
I tried this, but I keep getting a compiler error.
What am I doing wrong?

monitorStackPointer()
{
long value;
__asm { mov value, SP }

Keith,

The register is named "esp" in the 32-bit Intel world:

_asm mov value, esp;

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top