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
Flight Lieutenant
Posts: 487
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: A new well-known compiler

Post by iss » Sat May 10, 2014 1:20 am

Thanks Dbug for the nice (short and meaningful!) list. I'll definitely use it and report back.
Here is one 'real-life' example - aes256 algo :).
aes256-sources.zip
aes256 source files
(5.57 KiB) Downloaded 168 times
Looking in sources:

Code: Select all

file aes256.c @line 25:
#define BACK_TO_TABLES
If it's uncommented the algo obviously uses tables for calculations and the speed is high:
CC65: 1.72 sec, 9503 bytes
aes256-tab-cc65.tap
aes256 using tables CC65
(9.28 KiB) Downloaded 162 times
OSDK: 1.70 sec, 13350 bytes
aes256-tab-osdk.tap
aes256 using tables OSDK
(13.04 KiB) Downloaded 165 times
If the above line is commented (i.e. not using tables)
CC65: 23.63 sec, 9302 bytes
aes256-tab-cc65.tap
aes256 using tables CC65
(9.28 KiB) Downloaded 162 times
OSDK: ??.?? sec, 14385 bytes
aes256-tab-osdk.tap
aes256 using tables OSDK
(13.04 KiB) Downloaded 165 times
Unfortunately the encryption fails and the back decryption never ends...
Count this as 'OSDK bug report' :).

User avatar
iss
Flight Lieutenant
Posts: 487
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: A new well-known compiler

Post by iss » Sat May 10, 2014 1:24 am

Continued ...
TXT - plain text
KEY - encryption key
ENC - encrypted message
TST - test - how the encrypted message should look like
DEC - decrypted plain text (i.e = TXT)
Here is what to expect as proper result:
snapshot.jpg
snapshot.jpg (18.03 KiB) Viewed 3332 times

User avatar
Dbug
Site Admin
Posts: 2357
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: A new well-known compiler

Post by Dbug » Sat May 10, 2014 6:50 am

You wrote CC65, so I guess you are not testing the gcc 6502?
Do you think you could get CC65 to output an assembler source code and attach it as well to your post?

This 9 KB vs 14 KB size different is indeed interesting, looks like CC65 has improved since when we were checking with Jede (more than 10 years ago).

Godzil
Squad Leader
Posts: 755
Joined: Sat May 21, 2011 7:21 pm
Location: Between UK and France
Contact:

Re: A new well-known compiler

Post by Godzil » Sat May 10, 2014 10:15 am

You also didn't tell that gcc wasn't designed for anything that have less than 32bit... There isn't any official 16bit cpu backend..

I cant expect it to make correct code for an 8bit cpu without lots and lots of changes inside and until it's official expect that it can disappear in a second

User avatar
iss
Flight Lieutenant
Posts: 487
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: A new well-known compiler

Post by iss » Sat May 10, 2014 12:46 pm

@Godzil: Good points. I agree with you.

@Dbug: Yes, currently I have OSDK and CC65 working side-by-side. I'm using common Makefile per project, so it's easy to compile everything with both toolchains. And yes, CC65 seams to be actively developped (unfortunately most changes are related to Commodore).
I hope to have GCC as an option soon too, but for now I succeeded only in building the compiler. My checks with dejagnu regression tests are far from the announced on the maintainer's site. I'm waiting his feedback.
Attached is aes256 demo compiled with CC65 with preprocessed files (look for *.c1 files :))
aes256-src+asm.zip
(79.02 KiB) Downloaded 167 times

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests