But can it self compile on the target machine?
EVIL THOUGHT I have TINY C version 1.0
can you boot strap with that?
Code generation requires lots of free registers because
most machines other than the 8 bitters do not have a uniform instruction set. You might have load store for byte or index operations or # constants, with a CISC format for the remainder of the operations. with Bengol I chose to limit complex instructions 1 function per statement and indexing to a simple term and no general unary operations.
expression := Unary r-value | term + {operand r-value } |
( expression )
Nice and simple to decode. The hardware I compile to
has 2 nice features Branches have good sized range ± 4KB. I have set logic condition for things like a= n<6
I can self compile to a 24KB program (20bit words/10 bit bytes, and ~32KB for my 8/16/32 bit cpu.
Ben.