News:

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

Main Menu

Recent posts

#11
Assembly discussions / Re: Verifying the support of t...
Last post by Vortex - March 16, 2026, 09:27:38 PM
Here is the 64-bit version :

include     movbeCheck.inc

.data

m1          db 'The processor does not support the instruction movbe.',0
m2          db 'The processor supports the instruction movbe.',0
StrTable    dq OFFSET m1,OFFSET m2

.code

start:

    sub     rsp,8+4*8
    call    main
    invoke  ExitProcess,0

main PROC PARMAREA=4*SIZEOF QWORD

LOCAL _rax:QWORD

    xor     rax,rax
    mov     _rax,rax
   
    mov     rax,1
    cpuid

    bt      rcx,22
    mov     rax,_rax
    adc     rax,0

    mov     rdx,OFFSET StrTable
    lea     rcx,[rdx+8*rax]

    invoke  printf,QWORD PTR [rcx]
    ret   

main ENDP

END start
#12
Assembly discussions / Verifying the support of the i...
Last post by Vortex - March 16, 2026, 08:45:29 PM
Hello,

To check if your processor supports the instruction movbe :

include     movbeCheck.inc

.data

m1          db 'The processor does not support the instruction movbe.',0
m2          db 'The processor supports the instruction movbe.',0
StrTable    dd OFFSET m1,OFFSET m2

.code

start:

    call    main
    invoke  ExitProcess,0

main PROC

    xor     eax,eax
    push    eax
   
    mov     eax,1
    cpuid

    bt      ecx,22
    pop     eax
    adc     eax,0

    mov     edx,OFFSET StrTable
    lea     ecx,[edx+4*eax]

    invoke  printf,DWORD PTR [ecx]
    ret   

main ENDP

END start
#13
General discussion / Re: Compiling using pomake
Last post by TimoVJL - March 16, 2026, 08:09:44 PM
How project works with version 14 rc1 ?

It is possible to have many Pelles C versions in test PC
#14
General discussion / Re: Compiling using pomake
Last post by rweidner - March 16, 2026, 07:52:25 PM
Yes, main.c is in a different directory. I have a reason for it. It is just not a great reason. LOL.

My personal convention is to keep the program entry point next to the project file. The goal is simple: if I come back to this code months or years later, I do not want to hunt for the entry point. I also typically build the .exe next to the project file while I am debugging, so having main.c at the top level feels like it belongs with the build/run artifacts.

So for me, the top-level folder is "project management." Finding the entry point is barely in that domain, but it is in it enough that this pattern stuck.

Everything else that is "real code" lives under src\ (and headers under src\include\). Assets, deps, and notes get their own folders.

This layout is pretty typical for me:

C:\dev\XecronixEngine\FBIPursuit>tree /F
Folder PATH listing
Volume serial number is 73AB-A1AE
C:.
│   env_pelles32.bat
│   FBIPursuit.exe
│   FBIPursuit.geany
│   FBIPursuit.tags
│   main.c
│   project.bat
│   raylib.dll
│   RaylibWin32.ppj
│   RaylibWin32.ppx
│   RaylibWin32.tag
│   README.md
│   tags.bat

├───assets
│   │   scores
│   │
│   └───level1
│           astronaut12-energy-gaming-electro-trap-301124.mp3
│           astronaut12-ultimate-gaming-soundtrack-for-legends_astronaut-272122.mp3
│           astronaut12-victory-awaits-in-the-gaming-universe_astronaut-265184.mp3
│           baddie1.pdn
│           baddie1.png
│           civ1.pdn
│           civ1.png
│           click.wav
│           click_heavy.wav
│           damage.wav
│           explode.wav
│           fassounds-level-up-energetic-gaming-rock-music-251284.mp3
│           hero.png
│           hit.wav
│           hitslab-retro-retro-synthwave-gaming-music-270173.mp3
│           level.map
│           mroneilovealot-neon-overdrive-cyberpunk-gaming-edm-415723.mp3
│           sapan4-edm-gaming-music-335408.mp3
│           shot.wav
│           shots.png
│           song1.mp3
│           stereo-complete-in-dash.png
│           tiles.png

├───deps
│   │   MANIFEST.txt
│   │
│   ├───include
│   │       raylib.h
│   │       raymath.h
│   │       rlgl.h
│   │
│   └───lib
│           raylib.dll
│           raylib.lib
│           raylibdll.lib

├───output
│       actor.obj
│       actor_manager.obj
│       actor_templates.obj
│       game_sim.obj
│       gfx_manager.obj
│       high_score_sim.obj
│       main.obj
│       pause_sim.obj
│       settings_sim.obj
│       sfx_manager.obj
│       start_sim.obj
│       xx_input.obj

├───project_notes
│   │   game_rules.txt
│   │
│   ├───designIdeas
│   │       initialRoughEngineIdea.txt
│   │
│   └───milestones
│           milestones.txt
│           milestones_fbi_pursuit_v1_2026_02_27.md

└───src
    │   actor.c
    │   actor_manager.c
    │   actor_templates.c
    │   game_sim.c
    │   gfx_manager.c
    │   high_score_sim.c
    │   pause_sim.c
    │   settings_sim.c
    │   sfx_manager.c
    │   start_sim.c
    │   xx_input.c
    │
    └───include
            actor.h
            actor_manager.h
            actor_templates.h
            game_sim.h
            gfx_manager.h
            high_score_sim.h
            pause_sim.h
            settings_sim.h
            sfx_manager.h
            start_sim.h
            xx_conf.h
            xx_input.h
            xx_types.h

#15
Announcements / Re: Release Candidate #1 for v...
Last post by Vortex - March 16, 2026, 01:22:18 PM
To check if your processor supports MOVBE, run Coreinfo on the command prompt :

Coreinfo64.exe -f
Check the output of the tool to see if MOVBE is supported :

MOVBE           *       Supports MOVBE instruction
https://learn.microsoft.com/en-us/sysinternals/downloads/coreinfo
#16
Announcements / Re: Release Candidate #1 for v...
Last post by John Z - March 16, 2026, 12:57:35 PM
Quote from: Pelle on March 15, 2026, 06:39:56 PMSee https://www.pellesc.se/, Download and Changes.


Thanks very much!

John Z

P.S. ARM64 will be a good challenge as will finding testers. I think currently a general population of users is a few percent, for high end systems it is reportedly approaching 10% mainly due to high performance snapdragon systems.  AI supplied numbers  :(  Of course that neglects about 1 billion device in phones . . . .
#17
Bug reports / Re: bug report. setvbuf() func...
Last post by John Z - March 16, 2026, 12:09:50 PM
Thanks Pelle!

👍👍👍

John Z
#18
Announcements / Re: Release Candidate #1 for v...
Last post by Pelle - March 16, 2026, 10:07:35 AM
Well, the movbe instruction is rather old. Hard to find the complete history and origin, but possibly from ~2013.
I have hold back some progress for years, due to certain old processors, but I'm getting fed up with that. In a perfect world I rather drop X86/X64 and move permanently to ARM64. Or better yet: find another project to waste time on. We'll see...
#19
Announcements / Re: Release Candidate #1 for v...
Last post by Vortex - March 15, 2026, 10:08:07 PM
Hi Pelle,

Thanks for the new release. Poide is crashing on Windows 7 Sp1.
#20
Announcements / Re: Release Candidate #1 for v...
Last post by TimoVJL - March 15, 2026, 09:57:54 PM
Thanks for new version for testing.

Windows 7 SP1 with an old AMD CPU without MOVBE:

poide crash
ModLoad: 00000001`3f7c0000 00000001`3fb5c000   poide.exe
...
ModLoad: 000007fe`e2bc0000 000007fe`e2bec000   C:\code\PellesC14rc1\Bin\Wizards64\wininst.dll
(8964.84dc): Illegal instruction - code c000001d (first chance)
(8964.84dc): Unknown exception - code c000041d (!!! second chance !!!)
*** WARNING: Unable to verify checksum for poide.exe
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for poide.exe -
poide!WizScanForDependenciesA+0xe2846:
00000001`3f293d46 660f38f1442430  movbe   word ptr [rsp+30h],ax ss:00000000`009eebd0=0000

polink crash
ModLoad: 00000001`3f8f0000 00000001`3f935000   image00000001`3f8f0000

...
(8958.8a30): Illegal instruction - code c000001d (first chance)
(8958.8a30): Illegal instruction - code c000001d (!!! second chance !!!)
*** WARNING: Unable to verify checksum for image00000001`3f8f0000
*** ERROR: Module load completed but symbols could not be loaded for image00000001`3f8f0000
image00000001_3f8f0000+0x1984:
00000001`3f8f1984 0f38f14608      movbe   dword ptr [rsi+8],eax ds:00000000`00222220=baadf00d
polib fail
Building zlib.lib.
POLIB: fatal error: An internal error occurred.

https://uops.info/html-instr/MOVBE_R32_M32.html

Incompatible CPU
AMD Athlon(tm) II X2 220 Processor
Intel Core i5-2450M CPU


https://en.wikipedia.org/wiki/Jaguar_(microarchitecture)

Not sure, if this detect MOVBE
#include <intrin.h>

void __cdecl exit(int status);
int printf(const char * restrict format, ...);

#pragma comment(lib, "msvcrt.lib")
//#pragma comment(linker,"/subsystem:console,5.1")
void __cdecl mainCRTStartup(void)
{
    int __cdecl main(void);
    void __cdecl exit(int status);
    exit(main());
}

// CPUID.(EAX=01H, ECX=0H):ECX.MOVBE[bit 22]
// EAX, EBX, ECX and EDX
//  0,   1,   2,      3
int GetCPUFeature(void)
{
    int r[4];    // EAX, EBX, ECX and EDX
    int rc = 0;
    _cpuid(r, 0);    // Highest Function Parameter and Manufacturer ID
    if (r[0] != 0x500) {    //
        _cpuid(r, 1);    // Processor Info and Feature Bits
        rc = _bittest((const long int *)&r[2], 22);

    }

    return rc;
}

int main(void)
{
    printf("CPU options: %d\n", GetCPUFeature());
    exit(0);
}