On Wednesday, August 28, 2019 at 10:48:19 AM UTC-4, Donn Stewart wrote:
I made a simple 8-bit processor with TTL. It is a pure accumulator-memory machine, with 30 instructions. I have a good assembler. Is it possible to retarget LCC to this processor? How do I go about it?
For sure. It has been done a number of times. One example is mine at
https://sites.google.com/site/lcc1802/ I learned a lot from one at
http://www.fpgacpu.org/usenet/lcc.html
The basic unit of a target is called a machine descriptor file - mine is xr18CX.md. The compiler front end understands C and converts it to an internal form. your md file contains rules that convert from the internal form to assembly language which you
then process in a separate pass.
It's not trivial, but it's quite do-able. Traditionally, you start by taking one of the existing .md files and changing all the assembly output to something you can handle, and go from there.
I can maybe provide some help if you need it.
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)