News:

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

Main Menu

Recent posts

#81
Assembly discussions / Re: Saving the volatile regist...
Last post by TimoVJL - February 23, 2026, 10:48:52 AM
Good example for using shadow place in x64
#82
Projects developed with Pelles C / Some of my programs were devel...
Last post by alderman2 - February 23, 2026, 10:22:52 AM
It would be too many posts to post all my programs in separate posts. I'll include a link to some of them.
Sad that this thread has gone quiet. Would be interesting to see other people's software.

Here are some of my programs:
https://exmag.se/ladda-ner-mjukvara/
#83
Assembly discussions / Re: Saving the volatile regist...
Last post by Vortex - February 22, 2026, 07:41:16 PM
Here is another attempt :

include SaveRegs.inc

SaveRegs MACRO

    mov     QWORD PTR [rbx],rcx
    mov     QWORD PTR [rbx+8],rdx
    mov     QWORD PTR [rbx+16],r8
    mov     QWORD PTR [rbx+24],r9

ENDM

.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:

    sub     rsp,8+4*8

    push    rsp
    pop     mainRsp

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

    invoke  ExitProcess,0

main PROC uses rsi rdi rbx x:QWORD,y:QWORD,w:QWORD,z:QWORD PARMAREA=4*SIZEOF QWORD

    LOCAL   temp1:QWORD

    mov     rbx,mainRsp
    SaveRegs

    xor     rsi,rsi
    mov     rdi,1

    invoke  MessageBox,0,ADDR msg,ADDR title,0
   
;   The first call to MessageBox destroys rcx,rdx,r8 and r9

    invoke  MessageBox,0,[rbx],[rbx+8],0
   
    ret

main ENDP

END start
#84
Feature requests / ADDIN_ENUM_PROJECT_FILES struc...
Last post by John Z - February 21, 2026, 02:55:09 AM
The Addin_EnumProjectFiles uses ADDIN_ENUM_PROJECT_FILES structure.
The request is to add a flag to the structure and set the flag if the file is in excluded state.
Current there seems to be no method to determine if a file is excluded using the Addin messages.

Addin's can include and exclude but seems nothing is able to report back the state of a source file.

John Z
#85
Feature requests / Re: Enhanced editor suggestion...
Last post by PhilG57 - February 20, 2026, 06:41:23 PM
Thanks, but I don't think this is it.  I'm hoping for a capability that, while in the editor, I can know if a particular compiler symbol is defined or not.  A symbol like "_WIN32" or "__32BIT__" or more likely some user symbol defined in the code itself and evaluated (by the preprocessor??) with #ifdef and #ifndef statements.  With this capability I could, while in the editor, know and see which path through the source code the preprocessor and compiler is taking.

I didn't actually look at your suggestion seeing as it referenced .obj (already compiled) files so if I am missing the boat here, please LMK.  Thanks. 
#86
Tips & tricks / Re: Testing resource enum
Last post by Vortex - February 18, 2026, 06:10:40 PM
Hi Timo,

Thanks. Compiling your code, here is my output on Windows 7 :

load powercfg.cpl
#1
#2
#3
#4
#5
#6
#7
#8
#9
#10

Enumerating with Podump :

podump.exe /RESOURCES:HEADERS C:\Windows\System32\powercfg.cpl | findstr "type"
File type: DLL
    type: "MUI", name: 1, language: 1033
    type: "WEVT_TEMPLATE", name: 1, language: 1033
    type: ICON, name: 1, language: 1033
    type: ICON, name: 2, language: 1033
    type: ICON, name: 3, language: 1033
    type: ICON, name: 4, language: 1033
    type: ICON, name: 5, language: 1033
    type: ICON, name: 6, language: 1033
    type: ICON, name: 7, language: 1033
    type: ICON, name: 8, language: 1033
    type: ICON, name: 9, language: 1033
    type: ICON, name: 10, language: 1033
    type: GROUP ICON, name: 202, language: 1033
    type: VERSION, name: 1, language: 1033
    type: MANIFEST, name: 124, language: 10338
#87
Tips & tricks / Testing resource enum
Last post by TimoVJL - February 18, 2026, 04:01:18 PM
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>

#pragma comment(lib, "user32.lib")

int WINAPI EnumResNameProc(HMODULE hModule, LPCSTR lpType, LPSTR lpName,LONG_PTR lParam);

int main(void)
//void __cdecl mainCRTStartup(void)
{
    HMODULE hMod = LoadLibraryEx(TEXT("powercfg.cpl"), NULL, LOAD_LIBRARY_AS_DATAFILE);
    if (hMod) {
        puts("load powercfg.cpl");
        EnumResourceNames(hMod, MAKEINTRESOURCE(RT_ICON), (ENUMRESNAMEPROC)EnumResNameProc, 0);
        FreeLibrary(hMod);
    }
    return 0;
    // ExitProcess(0);
}

int WINAPI EnumResNameProc(HMODULE hModule, LPCSTR lpType, LPSTR lpName,LONG_PTR lParam)
{
    TCHAR szTmp[100];
    if (IS_INTRESOURCE (lpName)) {
        wsprintf(szTmp, TEXT("#%u"), lpName);
        puts(szTmp);
    } else
        puts(lpName);
    return 1;
}
#88
Bug reports / Re: O_BINARY
Last post by TimoVJL - February 18, 2026, 12:10:17 AM
#89
Bug reports / O_BINARY
Last post by Robert - February 17, 2026, 11:52:49 PM
Pelles C .chm documentation states

_setmode function
Declared in:
<io.h>
however, the definitions for the _setmode function "mode" parameter arguments

_O_BINARYetc.,

are not in
<io.h>but, instead, are located in
<fcntl.h>
The <io.h> header should
#include <fcntl.h>

#90
Feature requests / Re: Enhanced editor suggestion...
Last post by TimoVJL - February 16, 2026, 04:46:06 PM
https://forum.pellesc.de/index.php?msg=41529

Modify this for a your purposes.
Use pope.exe to examine obj-files for symbols.