News:

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

Main Menu

Recent posts

#21
Announcements / Re: Release Candidate #2 for v...
Last post by TimoVJL - March 30, 2026, 11:14:14 AM
Thanks,
that i can still use my an old PC full of an old C-code for testing new version.
#22
ARM64 discussions / Not frustrated enough? Too muc...
Last post by Pelle - March 30, 2026, 10:09:19 AM
Well, why not try writing some ARM64 (RISC) assembly code?

Here is a small example for POASM, displaying a typical "Hello, world" message box:

NULL            equ     0
MB_OK           equ     0
EXIT_SUCCESS    equ     0

                area .rdata, data, readonly

message         dcb     "Hello, Windows on ARM64!", 0
title           dcb     "POASM test", 0

                area .text, code

                export main

                import __imp_ExitProcess
                import __imp_MessageBoxA

main            function

                stp     fp,lr,[sp,#-16]!
                mov     fp,sp

                mov     x0,NULL
                adrp    x1,message
                add     x1,x1,message
                adrp    x2,title
                add     x2,x2,title
                mov     w3,MB_OK
                adrp    x8,__imp_MessageBoxA
                ldr     x8,[x8,__imp_MessageBoxA]
                blr     x8

                mov     w0,EXIT_SUCCESS
                adrp    x8,__imp_ExitProcess
                ldr     x8,[x8,__imp_ExitProcess]
                blr     x8

                ldp     fp,lr,[sp],#16
                ret       

                endfunc

                end

The C version is just a tad shorter:

int main(void) {
  MessageBoxA(NULL, "Hello, Windows on ARM64!", "POASM test", MB_OK);
  ExitProcess(EXIT_SUCCESS);
}
#23
Announcements / Re: Release Candidate #2 for v...
Last post by Pelle - March 30, 2026, 10:03:26 AM
Thanks. Maybe not too many more rounds this time? We'll see...
#24
Bug reports / Re: TEXTEQU statement freezing...
Last post by Pelle - March 30, 2026, 09:57:27 AM
You're welcome...  :)
#25
Announcements / Re: Release Candidate #2 for v...
Last post by John Z - March 30, 2026, 12:24:28 AM
Thanks Pelle!

Testing round 2  :)

John Z
#26
Bug reports / Re: TEXTEQU statement freezing...
Last post by Vortex - March 29, 2026, 08:59:59 PM
Hi Pelle,

Many thanks for the fix in Poasm Version 14.00.1 released with Pelles C 14 RC2
#27
Announcements / Release Candidate #2 for versi...
Last post by Pelle - March 29, 2026, 06:10:50 PM
See https://www.pellesc.se/, Download (and Changes).

Changes from Release Candidate #1:
  • Stopped using instruction MOVBE for load/store with byte-swap in the X64 code generator. Ditto for the X86 code generator.
  • Fixed infinite recursion in POASM, from a construct like: MessageBoxA TEXTEQU <MessageBoxA>.
  • Stopped auto-installing buildver.dll in Bin\AddIns64 directory.
  • Minor revision to default manifest for IDE resource editor.
  • Minor documentation fix.
#28
Assembly discussions / Basic like put command
Last post by Vortex - March 28, 2026, 08:43:49 PM
Basic like put command sample :

include     OpenNewTxtForOutput.inc

.data

msg         db 'This is a test.',0
msg2        db 'Another test',0
file        db 'Test.txt',0

.data?

hFile       dd ?

.code

OpenNewTxtForOut PROC filename:DWORD

LOCAL mode:DWORD

    mov     mode,'w'
    invoke  fopen,filename,\
            ADDR mode
    ret

OpenNewTxtForOut ENDP

put PROC handle:DWORD,pMemory:DWORD
   
    invoke  lstrlen,pMemory
    invoke  fwrite,pMemory,1,\
            eax,handle
    ret

put ENDP
   
close PROC handle:DWORD

     invoke fclose,handle
     ret

close ENDP

start:

    invoke  OpenNewTxtForOut,ADDR file
    mov     hFile,eax
   
    invoke  put,eax,ADDR msg
    invoke  put,hFile,ADDR msg2
    invoke  close,hFile
   
    invoke  ExitProcess,0

END start

#29
Beginner questions / Re: same code pelles c and gcc...
Last post by Pelle - March 28, 2026, 12:34:09 PM
Quote from: John Z on March 28, 2026, 10:56:36 AMDownloaded n3220 working draft.

Problem is not your English - it is the inconsistency in the proposed spec.
Thanks for looking at this! Glad it's not just me, then...

Until there is a clearer picture, I will not change anything. The GCC distribution for Windows, that I have found in recent years (they seem to come and go), have been of somewhat dubious quality. I havn't seen this for LLVM yet. Microsoft may get to <stdbit.h> in 2035. Maybe.

For now, there are other functions doing the same job; for Windows: _BitScanForward(), _BitScanReverse(), _BitScanForward64(), and _BitScanReverse64(); more generic: _bit_scan_forward(), _bit_scan_forward64(), _bit_scan_reverse(), _bit_scan_reverse64(). No requirement on C23.
#30
Beginner questions / Re: same code pelles c and gcc...
Last post by John Z - March 28, 2026, 10:56:36 AM
Downloaded n3220 working draft.

Problem is not your English - it is the inconsistency in the proposed spec.

Sections 7.18.3 through 7.18.6 clearly indicate the direction to 'count' from. 'Leading' is from MSB to LSB,
'Trailing' is from LSB to MSB these are specifically spelled out in each of these sections under item #2.

However

Sections 7.18.7 through 7.18.12 drop the clarity. They seem to assume that everyone will guess "Leading" always means counting from MSB to LSB, and "Trailing" always means counting from LSB to MSB but do not ever specifically say so as in the previous sections.

Also have to be careful where some times use index as in Bit[0] - Bit[15] verses position Bit[1] - Bit[16]. or they say index +1 which is position or using w-1 which would be index  ::) different authors I'm guessing.

IMO -

John Z