News:

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

Main Menu

Recent posts

#21
General discussion / Compiling using pomake
Last post by rweidner - March 03, 2026, 05:27:26 PM
I noticed a post recently where someone was trying to compile using pomake. I didn't attempt to compile his examples. Others looked and determined the issue was user error.  But the whole thread got me thinking. Why compile from the command line?

I can explain why I use that approach. It may seem unusual to some, but it works for me. I let PellesC manage my *.ppj files, while I sometimes use a different IDE for coding. Project management and debugging stay in PellesC, and pomake handles the builds.

So, my questions are:
  • What workflow issue are you personally trying to solve if you're compiling from the command line?
  • What challenges does your "outside the box (IDE)" create, if any?
  • Did you solve those challenges? If so, how?

#22
Feature requests / Equate to get the stack alloca...
Last post by Vortex - March 01, 2026, 12:38:35 PM
Hi Pelle,

Poasm adjusts the stack to store the local variables and the shadow space of the X64 calling convention. For example :

main PROC a1:QWORD,a2:QWORD,a3:QWORD,a4:QWORD,a5:QWORD PARMAREA=4*SIZEOF QWORD

    LOCAL  temp1:QWORD
    LOCAL  temp2:QWORD
    LOCAL  temp3:QWORD
.
.

Poasm translates this to :

        sub     rsp, 72
My attempt to get the value of the substracted amount :

https://forum.pellesc.de/index.php?msg=41979

The purpose of this operation is to save correctly the volatile registers rcx,rdx,r8 and r9 to the shadow space of the calling procedure. My method is to get the allocation from the statement add rsp,X before ret.

Kindly, could you implement an internal equate like @StackRes ( stack reservation ) simplifying the access to the shadow space? It would be the coder's responsiblity to preserve this equate and take in account the volatile registers pushed to the stack by main PROC uses rsi edi etc.

An example :

main PROC a1:QWORD,a2:QWORD,a3:QWORD,a4:QWORD,a5:QWORD PARMAREA=4*SIZEOF QWORD

    LOCAL  temp1:QWORD
    LOCAL  temp2:QWORD
    LOCAL  temp3:QWORD
.
.

Poasm emitting @StackRes:

    mov    rax,@StackRes
    mov    temp3,rax
    mov    QWORD PTR [rsp+rax+8],rcx
    mov    QWORD PTR [rsp+rax+16],rdx
.
.
#23
Assembly discussions / Re: Saving the volatile regist...
Last post by Vortex - March 01, 2026, 12:19:19 PM
Here is how to get the stack allocated by a Poasm procedure. The task is to get the allocation from the statement add rsp,X before ret :

include RegsToShadSpace.inc

.data

msg     db 'Hello!',0
msg2    db 'rcx,rdx,r8 and r9 are saved.',0
title   db 'MsgBox',0
title2  db 'Macro test',0

.data?

mainRsp dq ?

.code

start PROC PARMAREA=5*SIZEOF QWORD

    invoke  main,ADDR msg2,ADDR title2,10,20,30

    invoke  ExitProcess,0
    ret

start ENDP

main PROC a1:QWORD,a2:QWORD,a3:QWORD,a4:QWORD,a5:QWORD PARMAREA=4*SIZEOF QWORD

    LOCAL  temp1:QWORD
    LOCAL  temp2:QWORD
    LOCAL  temp3:QWORD

    mov    temp1,1
    mov    temp2,2

    mov     rax,-1

;   How     the stack release instructions are encoded?
;   Example :

;   add     rsp, 88   ; 48: 83. C4, 58
;   add     rsp, 136  ; 48: 81. C4, 00000088

    mov     r10,OFFSET StackReservation
    cmp     WORD PTR [r10],08348h
    jne     l1

    movzx   rax,BYTE PTR [r10+3]
    jmp     l3

l1:

    mov     eax,DWORD PTR [r10+3]

l3:
    lea     rax,[rsp+rax+8]
    mov     temp3,rax
    mov     QWORD PTR [rax],a1
    mov     QWORD PTR [rax+8],a2
    mov     QWORD PTR [rax+16],a3
    mov     QWORD PTR [rax+24],a4   

;   MessageBox destroying parameters a1,a2,a3 and a4

    invoke  MessageBox,0,ADDR msg,ADDR title,0

;   Retrieve the volatile registers from the shadow space

    mov     r10,temp3
    invoke  MessageBox,0,[r10],[r10+8],0

StackReservation:   

    ret

main ENDP

END start
#24
General discussion / Re: Pellesc site down?
Last post by Vortex - February 27, 2026, 10:49:09 AM
Official announcement by Pelle :

https://forum.pellesc.de/index.php?topic=11702.0
#25
General discussion / Re: Who pays and how much to u...
Last post by John Z - February 26, 2026, 09:06:16 PM
Hi ddainelis1,

Nice to hear your willingness to support the 'Dev Team' which is Pelle :)

However Pelle has decided to forgo any donations.  He has removed the method(s) to donate, and the latest update to  http://www.pellesc.se showing terms and conditions emphasizes it is totally free without any donation or fees.

John Z
#26
General discussion / Re: I think somethnig changed....
Last post by John Z - February 26, 2026, 08:51:39 PM
Hi ddainelis1,

A bit strange. I have been running 13.0.9 for a long time - I don't see the problem you are mentioning.
Did you do a complete uninstall of the 13.0.7 version before installing the newer version?

If you close all projects and files, then use Menu : Tools - Options you will get to the available settings.

You might try an uninstall and re-install too, especially if 0.9 was installed before 0.7 was uninstalled.

John Z


#27
General discussion / I think somethnig changed....
Last post by ddainelis1 - February 26, 2026, 06:39:28 PM
I was using Pelles C version 13.0.7 over the last few weeks.  Today i noticed version. 13.0.9 and installed it.
Did the UI change. Here is what i seen.  when i hit save all button it pops up a menu and asks what file to save. Then when i double click a file it did not open i had to use the open file menu drop down. 

If there are settings to get back to the old UI interactions  could you point me to the direction to read the setup.

Thank you

 
#28
General discussion / Re: Who pays and how much to u...
Last post by ddainelis1 - February 26, 2026, 06:14:00 PM
Hello Dev Team,

How can we donate if we choose.  Is there a link?   I would be willing to donate time to time. 

Best regards,
DJD
#29
General discussion / Re: Pellesc site down?
Last post by linuxbob - February 25, 2026, 10:27:31 PM
I got there using:

https://www.pellesc.se/
#30
Projects developed with Pelles C / Re: Some of my programs were d...
Last post by alderman2 - February 25, 2026, 12:26:01 AM
Quote from: MrBcx on February 24, 2026, 10:40:58 PM
Quote from: alderman2 on February 24, 2026, 08:57:40 PMMrBcx:

Are you a developer/owner of BCX?
I have it installed on my computer. Interesting program.


Yup ... I created BCX in 1999, open sourced it in 2004 and since 2019, I'm the maintainer again
with the help of other long time users.  Hopefully you find it interesting in a good way.   ;D

Fantastic! I'm impressed!
I have created a library of more than 800 functions with code that makes programming faster. One line to create a Windows, one line to create a button, etc. I have given them names so that you immediately understand what they are for. I started this in 1993 and most of it was finished in 2003. It is quite old code so I sometimes have to update them. For example, not all functions work with 64 bit.

I'll definitely take a closer look at BCX when I have time.