News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Poasm supported by Pelles C run-time library

Started by Vortex, May 23, 2012, 03:17:31 AM

Previous topic - Next topic

Vortex

I removed that message. Ironically, those bots are "interested" in C run-time libraries.  :biggrin:

jj2007

Hey, that phrase almost made sense - you are improving your bot :t

Gunther

Quote from: Vteobitov on August 18, 2015, 06:41:22 PM
For example, look to the content of the post above, and then to the content of the Erol's post two posts above - the spammer copied Erol's sentence.

One question remains: What's your programming language?

Gunther
You have to know the facts before you can distort them.

Vortex

QSort sample built with the modules extracted from Pelles crt0.lib :

include Sample.inc

CompareProc PROTO C :DWORD,:DWORD

NUMB_OF_ELEMENTS equ 10

.data

numbers     dd 29,12,32,65,58,7,12,11,11,97
format1     db '%d',13,10,0

.code

start:

    invoke  qsort,ADDR numbers,\
            NUMB_OF_ELEMENTS,\
            SIZEOF DWORD,ADDR CompareProc

    call    PrintArray

    invoke  ExitProcess,0
   

CompareProc PROC C arg1:DWORD,arg2:DWORD

    mov     ecx,arg1
    mov     edx,arg2
    mov     eax,DWORD PTR [ecx]
    sub     eax,DWORD PTR [edx]
    ret

CompareProc ENDP


PrintArray  PROC uses esi ebx

    mov     ebx,NUMB_OF_ELEMENTS
    mov     esi,OFFSET numbers
@@:
    invoke  printf,ADDR format1,\
            DWORD PTR [esi]

    add     esi,4
    dec     ebx
    jnz     @b
    ret

PrintArray ENDP


END start


\PellesC\bin\poasm _crt_constraint.asm
\PellesC\bin\poasm printf.asm
\PellesC\bin\poasm Sample.asm
\PellesC\bin\polink /SUBSYSTEM:CONSOLE /LIBPATH:\PellesC\lib\Win Sample.obj printf.obj qsort_s.obj memmove.obj memcpy.obj _crt_constraint.obj