return value

From: elekis (elekis_at_gawab.com)
Date: 04/14/04


Date: Wed, 14 Apr 2004 17:49:14 +0000 (UTC)

hi
I m learning asm with nasm and I have some prob whith the value return

if I have that in a file.asm

        mov eax [ebp+8]
        mov ebx [ebp+12]
        
        pusha
        push eax
        push ebx
        call getAndSetIndiceASM
        pop eax
        pop ebx
        popa
        

and in a other file.asm wher find the getAndSetIndiceASM function

CPU 386

GLOBAL mainASM

getAndSetIndiceASM:
                push ebp
                mov ebp, esp
        
                mov eax [ebp+8]
                    mul dword [ebp+12]

                mov esp, ebp
                pop ebp
                ret

PS that code is very stupid , it 'just to learn something and test linking.

my question is how can I do to have eax (the value return of the
getAndSetIndiceASM function) in after the call getAndSetIndiceASM
where must I put that value return . if I push in the stack, he will be
invisible because there is a mov esp ebp, . IF I leave in eax, the popa
  eax and the popa destroy the value.

So how can i have a return value of the assembler function in other
assembler fonction.

merci

a++



Relevant Pages

  • Re: return value
    ... >>and in a other file.asm wher find the getAndSetIndiceASM function ... IF I leave in eax, ... >> eax and the popa destroy the value. ... >>So how can i have a return value of the assembler function in other ...
    (comp.lang.asm.x86)
  • Re: return value
    ... >I m learning asm with nasm and I have some prob whith the value return ... >and in a other file.asm wher find the getAndSetIndiceASM function ... IF I leave in eax, ... > eax and the popa destroy the value. ...
    (comp.lang.asm.x86)