A new well-known compiler

Since we do not have native C compilers on the Oric, this forum will be mostly be used by people using CC65 or the OSDK. But any general C related post will be welcome !
User avatar
iss
Wing Commander
Posts: 1400
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: A new well-known compiler

Post by iss »

(Continuing this thread because the info is still preliminary to open new one.)



This is Ascii Frogger by @rax (without game logic) used as benchmark.
Attached you can find the source code and TAP files with self-explaining names which compiler was used.
You can compare the sizes of TAP's too.

Unfortunately the fastest compilers have more problems for normal usage - unimplemented use-cases, non standard C dialect, etc.
Attachments
ascii-frogger-benchmark.zip
(7.14 KiB) Downloaded 14 times

User avatar
iss
Wing Commander
Posts: 1400
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: A new well-known compiler

Post by iss »

... attached are all intermediate files from compilation (generated c->asm, objects, etc).
If someone is interested can have deeper look inside the compilations process.
Attachments
ascii-frogger-compilation.zip
(1.56 MiB) Downloaded 15 times

User avatar
jbperin
Flight Lieutenant
Posts: 403
Joined: Wed Nov 06, 2019 11:00 am
Location: Valence, France

Re: A new well-known compiler

Post by jbperin »

What's interesting in some compilers you're experiencing is that they are true 8 bits compilers.
I think it helps to make them more efficient and space saving.
It seems to me that the one in OSDK allways work on 16 bits variables even for simple 8 bits typed variables (such as unsigned char or char).

I also like the way they use the stack.

For gcc and kickc, the generated assembly code is surprisingly light.
Here's an example for instruction:

Code: Select all

vallo >>= 4;
VBCC does:
VBCCconvertsShift.PNG
Where Kickc does:
KickCconvertsShift.PNG
And GCC also does:
GCCconvertsShift.PNG
Very impressive.

Post Reply