Page 1 of 1

Clarity about choice of compiler - C or ASM

Posted: Wed Oct 19, 2022 11:50 am
by Oso
I'm still unclear on the subject of compiling via C or ASM. When I first used PureBasic a few weeks ago (seems like a long time ago now :) ), I recall from other posts that ASM was being replaced by C, in order to target a greater number of CPUs.

I downloaded my current paid licence in July and I guessed that it was likely to be set to compile in C by default, but I'm not sure that's the case. In my ...\Compilers\ folder, there are two compilers. Are we supposed to manually switch to the C compiler? Can we remain with ASM anyway?

Code: Select all

 Directory of C:\Program Files\PureBasic\Compilers

28/06/2022  17:45           613,968 pbcompiler.exe
28/06/2022  17:45           533,072 pbcompilerc.exe
If I open Compiler - Compiler Options, it shows "PureBasic 6.00 LTS (Windows - x64)" as the compiler. Is this ASM or C ? There are no alternatives in that drop-down list. Thanks.

Re: Clarity about choice of compiler - C or ASM

Posted: Wed Oct 19, 2022 12:25 pm
by mk-soft
The ASM backend compiler is the standard. The C-Backend compiler must be added manually in Preferences -> Compiler.

The exception here is Purebasic for macOS (M1) and Raspberry (Linux ARM). Here the compiler is the C-Backend by default and there is no ASM compiler because the processor instruction set is ARM.

Re: Clarity about choice of compiler - C or ASM

Posted: Wed Oct 19, 2022 12:34 pm
by Oso
mk-soft wrote: Wed Oct 19, 2022 12:25 pm The ASM backend compiler is the standard. The C-Backend compiler must be added manually in Preferences -> Compiler.
Thanks mk-soft. I guess as things stand, the majority of developers, with the exceptions you mention, should leave it set as it is then.

Re: Clarity about choice of compiler - C or ASM

Posted: Thu Oct 20, 2022 6:25 pm
by juergenkulow
If you use the command line version of PureBasic pbcompiler.exe translates via ASM or pbcompilerc.exe translates via C to EXE.
Using the command line compiler