User Tools

Site Tools


sd:sdcc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
sd:sdcc [2026/04/13 17:33] – created appledogsd:sdcc [2026/04/13 17:44] (current) appledog
Line 1: Line 1:
 = SD/CC = SD/CC
- +SD/CC is TinyC for the SD-8516.
-SD/CC TinyC for the SD-8516+
  
 == Introduction == Introduction
-A self-hosted C compiler has been on the table for quite some time. A few weeks ago I was able to get something set up where it could compile:+A self-hosted C compiler has been my goal for quite some time. I did BASIC and Forth first. BASIC was useful, Forth -- not so much (from a practical standpoint). 
 + 
 +At the end of March I was able to get something set up where it could compile:
  
     int main(void) { return 0; }     int main(void) { return 0; }
  
-The problem was that isn't very much. So looked at the BASIC expression parser and was trying to figure out how to get expressionsIt's a recursive descent parser so the fist thing I added was additive and multiplicative expressions:+The problem was that isn't very much. Weeks went by and couldn't figure it out. It was supposed to be just like the BASIC expression parser. recursive descent parser. So the first thing I added was additive and multiplicative expressions. Then suddenly it started working. I honestly don't know what changed because it wasn't working then suddenly it was and I couldn't remember changing anything in the code.
  
 <codify armasm> <codify armasm>
Line 31: Line 32:
 </codify> </codify>
  
-This kind of works, we can return 3+5 now; but need more. I've been trying to get a symbol table up and to define int; but it isn't working.+This works for + and -, we can return 3+5 now. Next added negative numbersI had to add a check for TOK_MINUS first and then emit a SUB A, B to get it to negate. 
 + 
 + 
 +== Integers 
 +* April 14th, 2026. 
 +I've been trying to get a symbol table up and to define int; but it isn't working. I think there is an off by one bug on the stack. Storing variables on the stack is something I don't fully understand or trust yet. 
 + 
 +What is really biting me in the ass is the system I came up with to pair 16-bit registers into 24-bit pointers. It's a charmingly retro, period-authentic thing. But it makes coding a bit hard when you need multiple pointers. I have a 'secret weapon' -- the ability to add more registers any time I want, but, I want to avoid going down that route if possible. Having so many registers already is supposed to be good enough.
  
 More to come. More to come.
sd/sdcc.1776101590.txt.gz · Last modified: by appledog

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki