Home > Root > Log book > A first dive into SDCC
A first dive into SDCC
Sunday 22 January 2023, by
All the versions of this article: [Deutsch] [English] [français]
I think I’m going to work on SDCC as I feel I’d rather make tools than make games. Making tools for one’s own work is very satisfying. And also, who wouldn’t want to write his own compiler?
Just joking. What I’ll try to do is, to add a processor to an existing compiler. That’s complicated enough.
So why SDCC?
- it’s adapted for older processors and controllers one finds in old video game consoles
- it allows to generate binaries for a cousin of the TLCS-900, the TLCS-90.
So I downloaded the source code and I checked it out. The technical documentation is sorely lacking for porting to new architectures, so I’m pretty much on my own. My strategy is going to be looking at how an existing processor target is coded, and then try to copy and improve to do the Neo Geo Pocket’s CPU.
Obviously I’d like to reuse the code for the TLCS-90, since according to the docs the assembly code is similar with my target CPU. But, oh deception: in the code, the 90 is not coded as an independent architecture. It’s coded as a variation of the Z80. And the 900 has nothing in common with this 8-bit CPU: there is no banking, for example So I don’t think I can use that.
I should probably look at how a "cleaner" CPU is coded, and start from scratch. The code for the AVR looks "clean".
More news to come...
View online : The Small Device C Compiler