News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Uptime Proc

Started by Jeaton, April 07, 2005, 06:03:01 PM

Previous topic - Next topic

Jeaton

I'm pretty new to asm, practicing by a writing a mIRC dll, anyway, I came across a problem I can't figure out.  When I call the dll, it only returns the first interger value(eax, the one that returns the day count) pushed into wsprintf, and nothing more.  Maybe one of you can see what I'm doing wrong..

    .data
      blah db "%li"

.....

uptme PROC mWnd:DWORD,aWND:DWORD,pData:DWORD,pParams:DWORD,show:DWORD,nopause:DWORD

    call GetTickCount
   
    mov ebx, 1000
    xor edx, edx
    div ebx

    mov ebx, 60
    xor edx, edx
    div ebx
    push edx

    xor edx, edx
    div ebx
    push edx

    mov ebx, 24
    xor edx, edx
    div ebx
    push edx

    push eax

    push offset blah
    push pData
   
    call wsprintf
    add esp, 12

    mov eax, 3
    ret

uptme endp

hitchhikr


blah db "%li:%li:%li",0
pData db 64 dup (0)


    call GetTickCount
   
    mov ebx, 1000
    xor edx, edx
    div ebx

    mov ebx, 60
    xor edx, edx
    div ebx
    push edx

    xor edx, edx
    div ebx
    push edx

    mov ebx, 24
    xor edx, edx
    div ebx
    push eax

    push offset blah
    push offset pData
    call wsprintf
    add esp,(5 * 4)


The number of %li = the number of extra arguments (2 push edx + 1 push eax) beside the output buffer (pData) and the format string (blah).

Jeaton

#2
I forgot to push another edx for the hour count, so I added it to my previous post. 

Anyway, that fixed the problem, thanks a lot.