A C compiler (to a 32 bit virtual machine running on 6502)

Programming the 6502 microprocessor and its relatives in assembly and other languages.
Post Reply
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

A C compiler (to a 32 bit virtual machine running on 6502)

Post by BigEd »

This might be of interest - it's a work in progress:
https://github.com/TheEnbyperor/bbc-c#bbc-c
"C compiler for the BBC Micro series of micros"

Includes
  • bbcvm a custom 32-bit x86-like virtual machine for the 6502
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: A C compiler (to a 32 bit virtual machine running on 650

Post by BigEd »

(This project is a cross-compiler to a VM running on a 6502. It's perfectly worthwhile, but personally, I'm much more interested in a C compiler that runs on the 6502 - even if it targets a virtual machine. It's a harder problem, to be sure. Open source is a must, of course. Even better if the compiler is written in C! But that's not truly important.)
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: A C compiler (to a 32 bit virtual machine running on 650

Post by BigEd »

(Handyandy reminds us of Hyper C, which has a 32 bit VM, (Edit: oops, no, see below,) mentioned in this earlier compiler thread:
viewtopic.php?f=1&t=4314&start=45
)
Last edited by BigEd on Sat Jul 06, 2019 1:56 pm, edited 1 time in total.
handyandy
Posts: 113
Joined: 14 Sep 2015
Location: Virginia USA

Re: A C compiler (to a 32 bit virtual machine running on 650

Post by handyandy »

Hyper C is actually a 16 bit VM for a 6502 or 65c02. It runs on the Apple II family of computers but modifying the source code it can be ported to other platforms and other CPUs like a 65816 in native mode. I'm not sure of modifying it to a 32 bit VM; that might break the tools. It came out before ANSI C so it's like K&R C.

Cheers,
Andy
Post Reply