Thread: __asm__ and return value problem?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768

    Question __asm__ and return value problem?

    The next function should return the stack pointer's value.
    I think I'm losing my mind, but how??? Am I missing something?
    I don't see a return... how could it return a value then?
    Code:
    unsigned long get_sp(void)
    {
            __asm__("movl %esp, %eax");
    }

    Thank you.
    Last edited by Devil Panther; 04-12-2004 at 05:41 PM.
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

Popular pages Recent additions subscribe to a feed