masm, paramteter falscher wert?



  • Hi leute,
    am Anfang ein bissl code

    extern "C" void* __stdcall set_val(LPBYTE dst, LPBYTE src, DWORD count);
    
    .586
    .MODEL SMALL,STDCALL
    .CODE
    public set_val
    set_val proc \
    dst:ptr byte,\
    src:ptr byte,\
    count:dword
    
    OPTION PROLOGUE:NONE,EPILOGUE:NONE
    .FPO (0,3,0,0,0,0)
    
    mov edx,[esp +0ch] ;edx = "count"
    mov edi,[esp +4]   ; edi points to "dst"
    
    mov esi,[esp+8]    ; esi points to "src"
    

    Sooo,.. mein prob ist das zwar die stack ptr's esp+x richtig sind aber im debug
    modus der wert der dst dem der eigentlichen src ist, der src des counters ist
    und count 0 ist, also nur die vars direkt nach set_val proc.

    Woran kann das liegen?

    mfg zeusi



  • OPTION PROLOGUE:NONE,EPILOGUE:NONE 
    set_val proc stdcall dst:ptr byte,src:ptr byte,count:dword 
    .FPO (0,3*4,0,0,0,0)
    
    	mov edx,[esp +0ch] ; edx = "count" 
    	mov edi,[esp +4]   ; edi points to "dst" 
    
    	mov esi,[esp+8]    ; esi points to "src"
    	;...
    	ret 3*4
    
    set_val endp
    OPTION PROLOGUE:PrologueDef ,EPILOGUE:EpilogueDef
    

    BTW: edi,ebx und edi mussen der WinABI nach erhalten bleiben



  • Jo danke,

    n pusha/popa wollte ich noch reinbasteln,...
    esi und edi brauche ich wegen movsb...

    ahhh.. bei .FPO 3*4 ist des rätsels lösung???? (gerade ohne zu testen...) 🙂

    grüüüße
    ---------------------------------
    edit:

    hmmm,.. wohl leider doch nicht,... 😕


Anmelden zum Antworten