Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Newbie Assembly Question

Name: Anonymous 2009-09-03 12:00

Stupid question:

I call the following function:

asm("movl %esp, %eax");

in part of my program and I get the stack pointer (no problems so far).

Why does the asm function return whatever is in the EAX register? Is that the point of the function, and if so why (i.e. why not let it return a value of your choosing, etc.)? This might seem incredibly stupid, but I have been learning Motorola 68000 processor architecture while looking at fiddling with assembly through high-level languages and I don't have a great grasp on x86 architecture on top of that...

Thanks in advance

Name: Anonymous 2009-09-03 12:50

I'm pretty sure the return value of the asm pseudofunction is undefined.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List