Hello,
I have just released the first version of a port of the vbcc compiler to the 65816 at: http://www.compilers.de/vbcc.html
It contains a C compiler, assembler, linker and ports of a C Library for the Apple IIgs, SNES and a simulator (which can easily be adapted to SBCs or embedded targets).
A few of the good things:
- compiler is under active development
- supports C99 (variable-length arrays, designated initializers etc.)
- generates optimized code (see dhrystones in sample directory)
- supports near-, far- and huge-pointers and memory models
- (limited) floating point support based on Steve Wozniaks code
- support for SNES hardware multiplication/division
- support for writing interrupt handlers
- attributes for putting variables into zero page
- supports file I/O on selected targets (IIgs)
If you want to have a look at the compiler, I would be interested in hearing your results.
Best regards,
Volker
65816 port of the vbcc C compiler
Re: 65816 port of the vbcc C compiler
Splendid!
Re: 65816 port of the vbcc C compiler
And some excellent documentation, too. (Though my interest is in a generic WDC 65c02 target.)
Neil
Neil
Re: 65816 port of the vbcc C compiler
barnacle wrote:
And some excellent documentation, too. (Though my interest is in a generic WDC 65c02 target.)
If you have any problems, just let me know.
Re: 65816 port of the vbcc C compiler
C99 for the 65816? Sign me up!
I'm using the WDC C compiler at the moment (I believe it's mostly just the Zardoz compiler rebranded) and it's... frustrating.
Ultimately I'd like to write a low level intermediate language for the '816 that both C and C++ can compile to. But. I am years and years from that point.
I still need to be able to write (non asm) code now though and that's why vbcc seems really appealing. I think I tried Calypsi for a bit but there was something critical lacking so I stopped.
I'm using the WDC C compiler at the moment (I believe it's mostly just the Zardoz compiler rebranded) and it's... frustrating.
Ultimately I'd like to write a low level intermediate language for the '816 that both C and C++ can compile to. But. I am years and years from that point.
I still need to be able to write (non asm) code now though and that's why vbcc seems really appealing. I think I tried Calypsi for a bit but there was something critical lacking so I stopped.
Re: 65816 port of the vbcc C compiler
Excellent!
What memory models are supported? Can I restrict code to execute in a single bank?
My assumption is it completely runs in native mode, right?
What memory models are supported? Can I restrict code to execute in a single bank?
My assumption is it completely runs in native mode, right?
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/
Re: 65816 port of the vbcc C compiler
fachat wrote:
What memory models are supported?
Quote:
Can I restrict code to execute in a single bank?
Quote:
My assumption is it completely runs in native mode, right?
Re: 65816 port of the vbcc C compiler
I have just uploaded a second release of the vbcc compiler for the 65816 at: http://www.compilers.de/vbcc.html
Changes since r1:
- new floating point format based on MSBASIC code
- more complete math library
- vc allows passthrough of linker options
- certain options like stack size can now be specified on the command line
- minor code improvements
- a few bug fixes
- new versions of vasm/vlink
The biggest change is the addition of a floating point library based on the 6502 MSBASIC code which has been MIT licensed. It is much, much faster than the wozfp-based code (the mandelbrot demo from the samples directory is about 10 times faster).
Changes since r1:
- new floating point format based on MSBASIC code
- more complete math library
- vc allows passthrough of linker options
- certain options like stack size can now be specified on the command line
- minor code improvements
- a few bug fixes
- new versions of vasm/vlink
The biggest change is the addition of a floating point library based on the 6502 MSBASIC code which has been MIT licensed. It is much, much faster than the wozfp-based code (the mandelbrot demo from the samples directory is about 10 times faster).
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: 65816 port of the vbcc C compiler
vbc wrote:
I have just uploaded a second release of the vbcc compiler for the 65816...new floating point format based on MSBASIC code...It is much, much faster than the wozfp-based code (the mandelbrot demo from the samples directory is about 10 times faster).
10× speedup is a huge leap.
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: 65816 port of the vbcc C compiler
BigDumbDinosaur wrote:
10× speedup is a huge leap.
I had no idea the Microsoft FP code was that much more efficient than the Wozniak-Rankin version.
Quote:
I take it you did some optimization to take advantage of the 65C816?
Not having benchmarked my changes, I do not think they make that much of a difference. The 6502 version shows a similar improvement over the Wozniak-Rankin code.
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: 65816 port of the vbcc C compiler
vbc wrote:
The Wozniak-Rankin code is highly optimized for size, but it is very slow. I think it does a lot of bitwise shifting without much speed optimizations.
Interesting. I have not looked much at the Wozniak-Rankin code, so I wasn’t aware that they were targeting size rather than speed. I suppose it made sense in the days when RAM was precious and zero page space was even more so.
BTW, I must commend you on the documentation published with the vbcc compiler package. It’s lucid and to the point.
x86? We ain't got no x86. We don't NEED no stinking x86!