Author Topic: Poasm supported by Pelles C run-time library  (Read 52995 times)

Vortex

  • Moderator
  • Member
  • *****
  • Posts: 2790
Re: Poasm supported by Pelles C run-time library
« Reply #45 on: May 16, 2015, 03:59:16 AM »
I removed that message. Ironically, those bots are "interested" in C run-time libraries.  :biggrin:

Vteobitov

  • Regular Member
  • *
  • Posts: 1
    • студия веб разработки
Re: Poasm supported by Pelles C run-time library
« Reply #46 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.

jj2007

  • Member
  • *****
  • Posts: 13945
  • Assembly is fun ;-)
    • MasmBasic
Re: Poasm supported by Pelles C run-time library
« Reply #47 on: August 18, 2015, 09:25:47 PM »
Hey, that phrase almost made sense - you are improving your bot :t

Gunther

  • Member
  • *****
  • Posts: 4196
  • Forgive your enemies, but never forget their names
Re: Poasm supported by Pelles C run-time library
« Reply #48 on: August 19, 2015, 06:00:47 AM »
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

  • Moderator
  • Member
  • *****
  • Posts: 2790
Re: Poasm supported by Pelles C run-time library
« Reply #49 on: September 26, 2019, 04:19:18 AM »
QSort sample built with the modules extracted from Pelles crt0.lib :

Code: [Select]
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

Code: [Select]
\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