Close
0%
0%

Small C 68XX

Building a Small C cross compiler for Motorola 6800, 6802, 6803, 6809 and 68HC11.

Similar projects worth following
I'm porting the Small C compiler from the Flex and C Users Groups disks to Linux so I can quickly create programs that can be run from a ROM monitor in the various boards I have. The Small C compiler is a rather easy way to support a large number of processors and have a small set of tools to work with.

I enjoy working with my collection of Motorola based computers and Single Board Computers (SBC). I've got clone SWTPC and other boards. Source for OS-9, Flex and Microware's RT-68. I want to get these boards running and displayed at the Computer Deconstrution Lab (https://compdecon.github.io/) in NJ.

This project has been on my mind for years but I've gotten a few more Motorola boards in the last few weeks and I'd like to get them up and running for display in my makerspace. So I gathered up my Small C books and searched the internet for the Flex OS (6800 & 6809) and C User groups disks for the source code to existing Small C implementations. I found a few and I've been putting them under git control on Github so I can bash the code into something that will compile under Linux and Windows. Now remember that the Small C compiler was written in the early days of C standards. So some of it is very ugly code. Threre's char * to int conversion that need to be correct for the new larger (64 bit) processors.

Right now I have mangled the Small C code under 6800 into something that seems to work. I need to test the code that gets generated on a board. The code under the 6800 directory outputs p-code in Motorola assembler (FCB 28 etc.). It then links to assembler code that is the interpreter. Very interesting unfortunately it's early v1.1 Small C so it's very limited. We'll see if we can extend it at some future date.

The code under the silifen directory actually generates assembler code so something executable is generated once assembled and linked. This code is in the process of being mangled. I think the code is Small C v2.1 but I'm not certain. The Small C compiler converts the p-code to assembler so no need to link an interpreter library. I'll be concentrating my efforts here for the time being.

The v22 directory contain the MSDOS Small C compiler. I started playing with this but switched to the silifen code when I found it.

I have more links, disks and iso source so expect more. I also have the Small C books and I'm reading the Small C Handbook by James E. Hendrix. That may help with documenting everything.

  • Pseudo code output progress

    Linux HA02/10/2023 at 03:49 0 comments

    After a bit more mangling of code I've managed to this Small C compiler to output code. I have not idea if it's correct and I need to still do a conversion from the CRASMB or XASM680X assemblers. I have documentation for the CRASMB assembler so I hope to be able to translate this from CRASMB to asl (the assembler I like to use). At the moment I have the Small C compiler taking some sample code and output it. Unfortunately that code really isn't for this compiler so I need to use one of the examples in the Flex LIB5* disks I have. Good news I I do have Flex emulators and a Flex machine (PT69-5A) working so I should be able to start testing there soon.

  • Flex OS emulator

    Linux HA02/08/2023 at 21:28 0 comments

    I've spent the last few days working on the Small C compiler, the Flexemu (for Linux - https://github.com/aladur/flexemu - requires a lot of QT dependencies which are not well spelled out) and the FreeDOS/Dosbox emulator. I have a Debian setup so I've been getting all of this working on my new Linux x86 system (old one crashes - hardware issue). I also use Mike Evenson's Memulator (http://www.evenson-consulting.com/swtpc/downloads/) which emulates a SWTPC 6800 or 6809 (Flex, OS-9, etc.). Finally I spent some time with the Pie editor. Still need to learn more about that one and see if I can get it assembled for the 6800. Things are slowly coming together.

View all 2 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates