News:

Download Pelles C here: http://www.pellesc.se

Main Menu

Recent posts

#11
Announcements / Re: Version 14.10 is now avail...
Last post by Pelle - April 24, 2026, 07:42:58 PM
Quote from: John Z on April 24, 2026, 07:22:46 PMThat was fast, thanks!
Some things went quicker than I thought, but I have no problem with that... ;D
#12
Announcements / Re: Version 14.10 is now avail...
Last post by John Z - April 24, 2026, 07:22:46 PM
That was fast, thanks!

John Z

Great! " silenced level 2 warning about possible "strict-aliasing violation" from <addin.h>" 👍👍👍
#13
Announcements / Version 14.10 is now available
Last post by Pelle - April 24, 2026, 06:17:10 PM
See https://www.pellesc.se/, Download (and Changes).
#14
User contributions / Re: Github-kuba miniz for Pell...
Last post by TimoVJL - April 24, 2026, 09:19:12 AM
Test projects without library for testing defines.
First project with static crt and second with pocrt.dll, so actual code size seen.
#15
User contributions / Re: Github-kuba miniz for Pell...
Last post by Vortex - April 23, 2026, 09:17:27 PM
Adding this line to the top of zip.c and rebuilding the static library :

#define ZIP_ENABLE_INFLATE 0
The size of my test executable dropped from 138K to 134K.
#16
User contributions / Re: Github-kuba miniz for Pell...
Last post by TimoVJL - April 23, 2026, 01:29:23 PM
A miniz main problem is, that it is one file and not easy to split modules for static library.

msvc have a -Gy option for that.


This tool can help with modified source code:
split source file using tags
Just have an another tool to add tags a new version of code.
#17
User contributions / Re: Github-kuba miniz for Pell...
Last post by Vortex - April 23, 2026, 12:52:49 PM
QuoteOptional features
The library supports three compile-time flags to strip unused functionality and reduce binary size. All features are enabled by default -- if you just drop the source files into your project and compile, everything works as before.

https://github.com/kuba--/zip
#18
Assembly discussions / Console scroll demo
Last post by Vortex - April 23, 2026, 12:03:04 PM
Here is a console scroll demo :

.386
.model flat,stdcall
option casemap:none

include ConsoleScroll.inc

.data

Coordinates dw  30,5
message     db '        This is a scroll test. ',0

.code

start:

    invoke  ClearScreen

    call    scroll
    invoke  ExitProcess,0

scroll PROC uses esi edi ebx

LOCAL hStd:DWORD

    invoke  GetStdHandle,STD_OUTPUT_HANDLE
    mov     hStd,eax

    mov     esi,OFFSET message
    invoke  lstrlen,esi
    mov     ebx,eax
    mov     edi,1
@@:
    invoke  SetConsoleCursorPosition,\
            hStd,Coordinates
           
    invoke  StdOut,esi
    invoke  Sleep,200
    add     esi,edi
    dec     ebx
    jnz     @b
    ret

scroll ENDP


ClearScreen PROC ; function from the Masm32 package

    LOCAL   hOutPut:DWORD
    LOCAL   noc    :DWORD
    LOCAL   cnt    :DWORD
    LOCAL   sbi    :CONSOLE_SCREEN_BUFFER_INFO

    invoke  GetStdHandle,STD_OUTPUT_HANDLE
    mov     hOutPut, eax

    invoke  GetConsoleScreenBufferInfo,hOutPut,ADDR sbi

    mov     eax, sbi.dwSize

    push    ax
    rol     eax, 16
    mov     cx, ax
    pop     ax
    mul     cx
    cwde
    mov     cnt, eax

    invoke  FillConsoleOutputCharacter,hOutPut,\
            32,cnt,0,ADDR noc

    invoke  locate,0,0
    ret
   
ClearScreen ENDP


locate PROC x:DWORD,y:DWORD ; function from the Masm32 package

LOCAL hOutPut  :DWORD
   
    invoke  GetStdHandle,STD_OUTPUT_HANDLE
    mov     hOutPut, eax

  ; -----------------------------------
  ; make both co-ordinates into a DWORD
  ; -----------------------------------
    mov     ecx,x
    mov     eax,y
    shl     eax,16
    mov     ax,cx

    invoke SetConsoleCursorPosition,hOutPut,eax

    ret

locate ENDP

StdOut PROC lpszText:DWORD ; function from the Masm32 package

LOCAL hOutPut  :DWORD
LOCAL bWritten :DWORD
LOCAL sl       :DWORD

    invoke  GetStdHandle,STD_OUTPUT_HANDLE
    mov     hOutPut, eax

    invoke  lstrlen,lpszText
    mov     sl,eax

    invoke  WriteFile,hOutPut,lpszText,\
            sl,ADDR bWritten,0

    mov     eax,bWritten
    ret

StdOut ENDP

END start
#19
Beginner questions / Re: same code pelles c and gcc...
Last post by Pelle - April 23, 2026, 10:21:31 AM
Quote from: mid-kid on April 22, 2026, 09:50:18 PMI hope this helps solve the conundrum  :D
Yes, it does. Thanks!  :)

This is the good news. The bad news is I have to go back and fix the code in several places. Bah.
#20
User contributions / Re: Github-kuba miniz for Pell...
Last post by TimoVJL - April 23, 2026, 08:53:44 AM
Why not do bit more
int __cdecl main(void)
{
    zip_t *zip = zip_open("test.zip", ZIP_DEFAULT_COMPRESSION_LEVEL, 'w');
    if (zip) {
        zip_entry_open(zip, "sample.docx");
        zip_entry_fwrite(zip, "sample.docx");
        zip_entry_close(zip);
        zip_close(zip);
    }
    return 0;
}