With a friend of mine, we tried a POC with z80 this year to see how it goes.

While feasible, there is a great amount of work. For our POC, instead of 
generating .o which changes from target platform, we generated .asm and use the 
platform assembler, linker …

We also choose to generate only 16bit register operations either with 8bit 
register pairs or using pseudo-register variables.

Our approach was to create a lot of macros and ask tcc to call the macros 
instead of real z80 code. The macros could be viewed as an ideal 8bit processor 
VM machine having 3 or 4 general purpose 16bit registers. This was the idea.

This way, having a 6802, 6809 compiler requires only to write macro for it and 
use machine dependent tools for code generation, linking and debugging.

After around 3 or 4 weeks, we were able to generate few .COM samples on CP/M 
emulator.

 

From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of Bill Gaylord
Sent: Tuesday, November 10, 2020 21:29
To: tinycc-devel@nongnu.org
Subject: [Tinycc-devel] Retargeting TCC to a 8bit device

 

I am wondering if anyone has had an experience retargeting TCC to a 8bit micro 
or cpu? I am working on a homebrew CPU (have an emulator need to work on the 
hardware.) and I want to be able to write C code for it instead of just pure 
assembly.

 

My only concern so far with looking at how to retarget it myself is that TCC 
needs you to have floating point available.  Or am I just reading the document 
incorrectly? 

 

Also I am wondering if I could not support some features of C in TCC. (For 
example. I literally can't do a long without using up 4 registers per number.  

 

Also any pointers would be appreciated. 

 

William Gaylord

_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to